ubuntu 12.04 mysql 错误 Errcode 13
2015-12-31 16:31
567 查看
转载自:http://www.cnblogs.com/zhangjun516/archive/2013/01/21/2869792.html
mysql> select * into outfile '/home/angelmylove/mysql/student.txt' fields terminated by ',' optionally enclosed by '"' lines terminated by '\n' from student limit 100;
ERROR 1 (HY000): Can't create/write to file '/home/angelmylove/mysql/student.txt' (Errcode: 13)
1,chmod -R 777 文件位置
2,
[/code]
If mysqld is included in enforce mode, then it is the one probably denying the write. Entries would also be written in
AppArmor blocks the writes/accesses. What you can do is edit
the bottom like so:
...
/usr/sbin/mysqld {
...
/var/log/mysql/ r,
/var/log/mysql/* rw,
/var/run/mysqld/mysqld.pid w,
/var/run/mysqld/mysqld.sock w,
/文件路径/ r, 添加要生成文件的路径
/文件路径/* rw,添加要生成文件的路径
//重新加载
mysql> select * into outfile '/home/angelmylove/mysql/student.txt' fields terminated by ',' optionally enclosed by '"' lines terminated by '\n' from student limit 100;
Query OK, 0 rows affected (0.00 sec)
mysql> select * into outfile '/home/angelmylove/mysql/student.txt' fields terminated by ',' optionally enclosed by '"' lines terminated by '\n' from student limit 100;
ERROR 1 (HY000): Can't create/write to file '/home/angelmylove/mysql/student.txt' (Errcode: 13)
1,chmod -R 777 文件位置
2,
# sudo aa-status 5 profiles are loaded. 5 profiles are in enforce mode. /usr/lib/connman/scripts/dhclient-script /sbin/dhclient3 /usr/sbin/tcpdump /usr/lib/NetworkManager/nm-dhcp-client.action /usr/sbin/mysqld 要是有这个表示mysql被限制了执行下面绿色的命令 0 profiles are in complain mode. 1 processes have profiles defined. 1 processes are in enforce mode : /usr/sbin/mysqld (1089) 0 processes are in complain mode.
[/code]
If mysqld is included in enforce mode, then it is the one probably denying the write. Entries would also be written in
/var/log/messageswhen
AppArmor blocks the writes/accesses. What you can do is edit
/etc/apparmor.d/usr.sbin.mysqldand add
/data/and
/data/*near
the bottom like so:
...
/usr/sbin/mysqld {
...
/var/log/mysql/ r,
/var/log/mysql/* rw,
/var/run/mysqld/mysqld.pid w,
/var/run/mysqld/mysqld.sock w,
/文件路径/ r, 添加要生成文件的路径
/文件路径/* rw,添加要生成文件的路径
//重新加载
# sudo /etc/init.d/apparmor reload
mysql> select * into outfile '/home/angelmylove/mysql/student.txt' fields terminated by ',' optionally enclosed by '"' lines terminated by '\n' from student limit 100;
Query OK, 0 rows affected (0.00 sec)
相关文章推荐
- MySQL数据库中16进制进行位运算
- 本地电脑连接阿里云RDS Mysql数据库问题(10038错误)
- mysql误操作引起的问题
- 深入理解mysql event事件调度器
- MySql动态生成SQL并执行
- MySQL中视图的安全验证方式
- mysql 查询表占用空间大小
- Mac 上安装MySQL
- 给mysql用户设置密码
- c连接mysql
- mysql 事件 按月分表
- mysql bit 总结
- mysql 权限设置
- MySQL配置简述
- mysql 学习资料
- mysql链接jdbc.URL参数的设置
- 详解MySQL查询缓存
- mysql 每秒钟查询次数、插入次数、删除次数、更新次数的统计
- You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version
- mysql 5.7.10使用dbforget Studio 连接异常