MySQL database does not work and returns “Can’t create/write to file” error

The problem is related to the mysql directory permission.

‘mysql’ user is not able to create a temporary file in /var/lib/mysql/ directory due to permissions lack

# ls -lda ~mysql/

drwxr-xr-x 5 root mysql 4096 Aug 31 09:56 /var/lib/mysql/

The solution is to go to /etc/init.d/mysqld_app_init file and change

chown root.mysql /var/lib/mysql

to

chown mysql.mysql /var/lib/mysql

Then restart mysqld service or just change owner of /var/lib/mysql directory to “mysql” instead of “root”

chown root /var/lib/mysql

Trackback URI | Comments RSS

Leave a Reply

You must be logged in to post a comment.