Stay Hungry, Stay Foolish

在ubuntu中出现mysql错误:ERROR 29 (HY000): File 'xxx' not found (Errcode: 13)

Linux 7181℃ 0评论

在进行数据导出的时候出现--secure-file-priv option so it cannot execute this statement问题时,修改/etc/mysql/mysql.conf.d/mysqld.cnf文件在末尾添加一句secure_file_priv="/"即可将数据导出到任意目录。
在使用mysql的load data的时候出现ERROR 29 (HY000): File 'xxx' not found (Errcode: 13),确定文件是存在的,感觉是权限问题,我把目录和文件权限都chmod为777后还是出错,chown 为mysql或其他用户也还是出错!最后发现mysqld强制编码了,文件没有写入权限,于是我把该文件目录也加到mysqld (/etc/apparmor.d/usr.sbin.mysqld这个文件的底部):
/path/to/load/是你要导入或导出的文件所在的位置:

/path/to/load/ r,
/path/to/load/** rwk,

然后:

# sudo /etc/init.d/apparmor reload
喜欢 (1)
取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,你说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦


Warning: Use of undefined constant PRC - assumed 'PRC' (this will throw an Error in a future version of PHP) in C:\inetpub\wordpress\wp-content\themes\XHBlog\comments.php on line 17
发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址