Saturday, April 5, 2014

[ERROR] Can't start server: can't create PID file: Permission denied

If you are getting this error messages when trying to start you MySQL server:
[ERROR] /usr/libexec/mysqld: Can't create/write to file '/var/run/mysqld/mysqld.pid' (Errcode: 13)
[ERROR] Can't start server: can't create PID file: Permission denied

You may want to try this to fix mysqld permissions:

sudo chgrp mysql /var/run/mysqld/
sudo chmod g+w /var/run/mysqld/

You might also need to change the permissions of the PID file itself:
sudo chgrp mysql /var/run/mysqld/mysqld.pid
sudo chmod g+w /var/run/mysqld/mysqld.pid

And then just start your MySQL server :)

No comments: