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

Posted by OtagoHarbour on Server Fault See other posts from Server Fault or by OtagoHarbour
Published on 2012-06-04T13:37:03Z Indexed on 2012/06/05 10:42 UTC
Read the original article Hit count: 263

Filed under:
|

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

mysql

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.

© Server Fault or respective owner

Related posts about mysql

Related posts about ubuntu-11.10