MySQL file access error on symlinked databasePosted: January 26, 2011
You move your MySQL data files to a different location and symlink the moved data directory back into the /var/lib/mysql. But then the MySQL keeps generating file permissons/ownership error (“Can’t read dir of” “(errno: 13)”). You check the permissions but they are OK.
Possible reason is AppArmor blocking software access to files in “unusual” locations.
Go to /etc/apparmor.d
Open file usr.sbin.mysqld
Add two lines inside the curly braces. Just add them to the end of the main list of directories. You shall add two lines for every single directory, one for the directory itself, another one for the files within it, like this:
Save the file.
Enter the command:
sudo service apparmor restart