load data infile:ERROR 29 (HY000): File '' not found (Errcode: 13 - Permission denied)

2019-02-16 08:46:13   错误异常
sudo vim /etc/apparmor.d/usr.sbin.mysqld

把你放文件的目录写进去,给这个目录下所有文件读写rw权限,例如我在最下面加了一个/tmp/* rw


# vim:syntax=apparmor
# Last Modified: Tue Jun 19 17:37:30 2007
#include <tunables/global>

/usr/sbin/mysqld {
  #include <abstractions/base>
  #include <abstractions/nameservice>
  #include <abstractions/user-tmp>
  #include <abstractions/mysql>
  #include <abstractions/winbind>

  capability dac_override,
  capability sys_resource,
  capability setgid,
  capability setuid,

  network tcp,

  /etc/hosts.allow r,
  /etc/hosts.deny r,

  /etc/mysql/** r,
  /usr/lib/mysql/plugin/ r,
  /usr/lib/mysql/plugin/*.so* mr,
  /usr/sbin/mysqld mr,
  /usr/share/mysql/** r,
  /var/log/mysql.log rw,
  /var/log/mysql.err rw,
  /var/lib/mysql/ r,
  /var/lib/mysql/** rwk,
  /var/log/mysql/ r,
  /var/log/mysql/* rw,
  /var/run/mysqld/mysqld.pid rw,
  /var/run/mysqld/mysqld.sock w,
  /run/mysqld/mysqld.pid rw,
  /run/mysqld/mysqld.sock w,

  /sys/devices/system/cpu/ r,
  /tmp/* rw,
  # Site-specific additions and overrides. See local/README for details.
  #include <local/usr.sbin.mysqld>
}  

然后重新加载

sudo /etc/init.d/apparmor reload

修改文件夹权限

sudo chmod -R 777 文件夹名字 
vien.tech版权所有,允许转载,但转载请注明出处和原文链接: https://vien.tech/article/51
欢迎小伙伴们在下方评论区留言 ~ O(∩_∩)O
文章对我有帮助, 点此请博主吃包辣条 ~ O(∩_∩)O

猜你喜欢


评论

There are no comments yet.
未登录

登录后即可发表评论

登录或注册