I'm trying to load a CSV file I have generated from PHP into a db table on my workstation. For some reason, mysql is complaining that the file is not found. I am absolutely certain I have specified the path to the file properly and I'm absolutely certain that the file is readable (774). I believe this may have something to do with AppArmor and have edited the config and reloaded it with no luck. Can someone give me a hint about how to get this file imported? I've tried importing it via phpmyadmin which seems to work VERY VERY VERY VERY slowly and keeps timing out.

The command:

LOAD DATA INFILE '/path/to/digital_raw.txt' INTO TABLE data_digital_raw  FIELDS TERMINATED BY ',' ENCLOSED BY '"' LINES TERMINATED BY '\n';

it returns this error:

ERROR 29 (HY000): File '/path/to/digital_raw.txt' not found (Errcode: 13)

But I know for a fact the file is there and readable by any user on my machine:

$ ls -al /path/to/digital_raw.txt
-rw-rw-r-- 1 sneakyimp sneakyimp 30083137 Jun 24 07:53 /path/to/digital_raw.txt

I read here about how AppArmor settings can prevent a mysql load for some stupid reason and I've even gone through the trouble of editing the app armor config file:

sudo nano /etc/apparmor.d/usr.sbin.mysqld

adding this line:

/path/to/ r,

and then reloading app armor:

sudo /etc/init.d/apparmor reload

The error persists. I've tried adding the LOCAL option to the mysql command but I get this complaint from mysql:

ERROR 1148 (42000): The used command is not allowed with this MySQL version

Any help would be truly appreciated. I need to get to work on this data and the file is not even very big (29M😎.

    OMFG I changed the apparmor line to have an asterisk at the end and it finally worked. :glare:

      /path/to/* r,

      Don't forget to mark the thread resolved. 😉

        Write a Reply...