Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have MySQL installed on Ubuntu 11.10. I has been working fine for months but yesterday I started getting the following message

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

and cannot get rid of it. I tried

/etc/init.d/mysqld start

and got

bash: /etc/init.d/mysqld: No such file or directory

The /etc/init.d/ directory contains mysql but not mysqld. I tried

sudo service mysql restart

It just hung for about half an hour and then I ctrl-C-ed it. I then tried

sudo service mysql start

I got

mysql start/running

But when I tried


I got

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

I tried

ps aux|grep mysql

and got

peter    17754  0.0  0.0   4196   768 pts/1    S+   09:38   0:00 grep --color=auto mysql

I ideas about fixing this problem would be most appreciated.

share|improve this question

migrated from Jun 5 '12 at 10:12

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

What does the log say? This is off-topic here, as it is not a programming question. – jordanm Jun 4 '12 at 13:42
/var/log/mysql.err is empty – OtagoHarbour Jun 4 '12 at 13:57
Seems like mysqld isn't running. Does /var/log/messages give something useful? – flooooo Jun 5 '12 at 10:41

Do you have the standard mysql.log file? Possibly called mysqld.log.

It could be that you're out of disk space, would explain the sudden problem, try:

$ df -h

Look at the 4th column "Avail"

share|improve this answer
Remember df -i for inodes, too, which can behave just like a full disk, without using up space.If all else fails, I might even try an strace so that I would have some info to go in. – DKing Jun 22 at 21:36

Your Answer


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.