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.
I have experienced same problem and applied the solutions above.
First of all my test environment are as follows
My testing results are
i) AppArmor solution only work for /tmp cases.
ii) Following solution works without AppArmor solution. I would like to appreciate Avnish Mehta for his answer.
$ mysql -u root -p --in-file=1
...
mysql> LOAD DATA LOCAL INFILE '/home/hongsoog/study/mysql/member.dat'
-> INTO TABLE member_table;
Important three points are
check all path element have world read permission from the / to data file path. For example, following subpath should be world readable or mysql group readable if INFILE is targeting for '/home/hongsoog/study/mysql/memer.dat'
When you start mysql client WITHOUT "--in-file=1" option and use
LOAD DATA LOCAL INFILE ..., you will get
ERROR 1148 (42000): The used command is not allowed with this MySQL version
In summary, "--in-file=1" option in mysql client command and "LOAD DATA LOCAL INFILE ..." should go hand in hand.
Hope to helpful to anyone.