Fixing "Can't find file: ... (errno: 13)" on mysql

Are you running something like selinux or some other similar package? I'd suggest disabling that (or modifying the security policies) to see if something there is preventing MySQL from being able to access the files.

[edit] If so, check syslog to see if selinux is blocking mysql from doing anything. If it is SELinux, I'm told this may disable it so that you might test this theory.

/usr/sbin/setenforce Permissive

strace is your friend in this instance. Find the process id of your mysql then run:

strace -efile -f -o /tmp/mysql.log -p $pid

In another window do something that causes the error. You can then press ctrl-c to kill strace. If you look in /tmp/mysql.log you should see what caused the problem.

As an aside, I really recommend you don't rely on copying the binary datafiles. SQL dumps are a lot more reliable and flexible. Also, it would appear you're using MyISAM. I'd really recommend against using those unless you don't care about the data in them. InnoDB has so many advantages over MyISAM.

Tags:

Mysql