Linux : MySQL InnoDB: Operating system error number 13 in a file operation

By | July 26, 2014

Have you encountered the following error starting MySQL server on a new machine that you’ve copied over the databases folder from another server?

140612 21:38:29 mysqld started
140612 21:38:29 InnoDB: Operating system error number 13 in a file operation.
InnoDB: The error means mysqld does not have the access rights to
InnoDB: the directory.
InnoDB: File name ./ibdata1
InnoDB: File operation call: ‘open’.
InnoDB: Cannot continue operation.
140612 21:38:29 mysqld ended

Even though the permissions are correct as followed :

MySQL data directory [/var/lib]

MySQL databases folder /var/lib/mysql

MySQL database [/var/lib/mysql/mysql]

This issue is probably caused by SELinux. You may disable it…

Edit SELinux configuration file :

And set the following :

Reboot your server and start MySQL daemon again :