The MySQL server is currently offline
I'm facing a problem with Green Geeks VPS my websites are going down almost five time a day due to MySQL server is offline and error establishing a database connection.
It gives me this error :-
Error while connecting to MySQL: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) Error while connecting to MySQL: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) at /usr/local/cpanel/Cpanel/Mysql.pm line 164.
I talked with support many times but I didn't get any solution after all and it keep on happening does anyone know how to solve this problem ?
-
Hello, You can run the following to create a symlink from /var/lib/mysql/mysql.sock to /tmp/mysql.sock ln -s /var/lib/mysql/mysql.sock /tmp/mysql.sock in SSH will do the trick Also you could add the following to /etc/my.cnf: [client] socket=/var/lib/mysql/mysql.sock Try it out and let me know. Thank You. EDIT: Removed incorrect syntax around /var/lib/mysql/mysql.sock 0 -
Hello :) Do you notice any specific error messages in /var/lib/mysql/$hostname.err at the time of the MySQL failures? Thank you. 0
Please sign in to leave a comment.
Comments
2 comments