
Plesk MySQL Server – Another MySQL daemon already running with the same unix socket
The past couple of mornings I have found my MySQL server has stopped on one of my CentOS servers that runs Plesk. When you browse to Plesk you get the following error…
1 2 |
ERROR: PleskFatalException: Unable to connect to database: mysql_connect(): Connection refused (auth.php:142)<span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 14px; line-height: 1.5em;"> </span> |
When you try and restart the MySQL sever you get the error…
1 |
service mysqld start |
1 2 3 |
Failed to start the "mysqld" service. Cannot start/stop/restart service: Another MySQL daemon already running with the same unix socket. Starting mysqld: [FAILED] |
I found a fix to get the server back up and running, run the following commands…
1 2 3 4 |
rm /var/lib/mysql/mysql.sock </code><code>service mysql stop </code><code>chown -R mysql:root /var/lib/mysql </code><code>service mysql start |
This will remove the MySQL sock from /var/lib/mysql directory and try to start your MySQL service. When the server restarts, it will recreate the file. Note that it also sets the correct permissions on the file.