mysql错误:ERROR 29 (HY000): File '/tmp/cun' not found (Errcode: 13)

32 篇文章 0 订阅
7 篇文章 0 订阅

突然遇到ERROR 29 (HY000): File '/tmp/cun' not found (Errcode: 13)错误,因为之前一直用的很好,换了个机器就出现这个问题了

mysql的操作语句:mysql> load data infile '/tmp/cun' into table cun1 fields terminated by '\t' lines terminated by '\r\n';


我一直因为是权限,问题,但是当我把目录和文件权限都chmod为777后还是出错,google了后发现:

Recent Ubuntu Server Editions (such as 10.04) ship with AppArmor and MySQL's profile might be in enforcing mode by default. You can check this by executing sudo aa-status like so:


# 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 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.

If mysqld is included in enforce mode, then it is the one probably denying the write. Entries would also be written in /var/log/messages when AppArmor blocks the writes/accesses. What you can do is edit/etc/apparmor.d/usr.sbin.mysqld and 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,
    /data/ r,
    /data/* rw,

}

And then make AppArmor reload the profiles.


# sudo /etc/init.d/apparmor reload

大体内容就是,mysqld强制编码了,文件没有写入权限,于是我把该文件目录也加到mysqld(/etc/apparmor.d/usr.sbin.mysqld这个文件的底部,如上粗体部分):

/root/* r,

/root/* rw,


加入上面的语句,解决问题。

转载:http://www.phpddt.com/db/mysql-error-29.html



  • 1
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值