Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Our mysql service went offline earlier and when we attempted to restart it we were presented with the following error:

System error 2: No such file or directory ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

We checked the mysql config and it is looking in: datadir=/var/lib/mysql socket=/var/lib/mysql/mysql.sock

but our mysql.sock file is no longer present in /var/lib/mysql/

We tried 'whereis mysql.sock' and it returned: mysql: /usr/bin/mysql /usr/lib/mysql /usr/share/mysql /usr/share/man/man1/mysql.1.gz

Several help guides suggested running: ln -s /var/lib/mysql/mysql.sock /tmp/mysql.sock

but /temp/ is empty.

Does anyone know how we might repair this problem please?

share|improve this question

migrated from stackoverflow.com Sep 7 '10 at 4:58

This question came from our site for professional and enthusiast programmers.

2 Answers 2

How are you starting it? On CentOS the init script will delete the socket file on stop. When MySQL is started via the same script the socketfile will be created. Perhaps you're attempting to start it manually and forgetting the --socketfile option?

share|improve this answer

I got the same problem with aix. I had to kill the running mysql (with sigterm, not sigkill), ensure that there wasn't sock files arround, and start it instead of restart

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.