LOAD DATA INFILE Error Code : 13

后端 未结 19 2501
有刺的猬
有刺的猬 2020-11-28 02:37

In my remote MySQL, when I try to execute this query, I am getting the MySQL Error Code : 13.

Query -

LOAD DATA INFILE 
\'/httpdocs/.../.../testFile.         


        
19条回答
  •  死守一世寂寞
    2020-11-28 03:29

    I had a lot of trouble to fix this, there are two things to do :

    • update file /etc/mysql/my.cnf with local-infile =1 at two locations after [mysql] paragraphs (this allows to use LOCAL INFILE sql command).

    • update via sudo gedit /etc/apparmor.d/usr.sbin.mysqld so apparmor will allow you to write into the special files of /var/www/ by adding the lines:

    /name of your directory/ r,

    /name of your directory/* rw,

    The name of your directory can be as /var/www/toto/ (this allows to use the directory where your files are located).

提交回复
热议问题