Can’t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock’

Overnight one of our servers had too many connections. Upon rebooting I now get the following via Plesk:

ERROR: PleskFatalException Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

0: /usr/local/psa/admin/plib/common_func.php3:108 psaerror(string 'Unable to connect to database: mysql_connect() [function.mysql-connect]: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)') 1: /usr/local/psa/admin/auto_prepend/auth.php3:93

When SSHing in, and trying to reboot MySQL I get 'Timeout error occurred trying to start MySQL Daemon'.

Could someone shed some light on this as it's a bit of an emergency. This is a live dedicated server and hasn't been touched in terms of configuration for a long while.

It's a Centos 5.1 install.

Yours, Chris


If it's a disk space issue, it may be worth clearing some log files from /var/log to get the server up and running; Longer term, you might want to consider moving the mysql folder to a different drive, or finding some way of shrinking the data bases (maybe by archiving old data). If at all possible, it may be time to look into getting a larger disk for the server.


As has already been said - you need to check the MySQL log files. Clearly MySQL is failing to start. Hopefully there is some sort of useful error in those log files to point you in the right direction. The vast majority of times I've seen this is has been because the partition on which MySQL stores it's raw data is full. By default this would the /var partition.

The default location for the MySQL logs is /var/log/mysqld.log

The following command will show you the status of all your partitions at a glance:

df -h