MySQL on Ubuntu cannot “load data infile”

“load data infile” imports were failing when running MySQL on Ubuntu 12.04.2 LTS because MySQL was unable to read the file.

AppArmour was preventing mysqld reading the file. This can be checked using aa-status:

Note that mysqld is listed as being in enforce mode.

To allow access to files in a praticular directory, add entries to  /etc/apparmor.d/usr.sbin.mysqld EG:

and make AppArmour reload its profiles:

Leave a Reply