Skip navigation links

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


Advanced Search

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
Posted by: Peter Lauren ()
Date: July 12, 2012 07:34PM

OK. There are a myriad of posts about this but there does not appear to be any one solution that works. I have tried other people's solutions but they do not work.

I have LAMP installed on Ubuntu 11.10. I type

$ mysql

and get

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

I tried

$ sudo service mysql stop

and got

mysql stop/waiting

then

$ sudo rm /var/run/mysqld/mysqld.sock

then

$ sudo service mysql start

and got

mysql start/running

However, when I typed

$ mysql

I got

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

Any assiatance with this would be greatly appreciated. Also are there any plans to fix this problem with mysql?

Many thanks in advance,
Peter

Options: ReplyQuote


Subject Written By Posted
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) Peter Lauren 07/12/2012 07:34PM
Re: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) Martín Colodrero 07/12/2012 09:29PM
Re: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) Peter Lauren 07/13/2012 07:21PM
Re: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) Martín Colodrero 07/13/2012 08:34PM
Re: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) Peter Lauren 07/13/2012 09:30PM
Re: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) Martín Colodrero 07/13/2012 09:56PM
Re: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) Peter Lauren 07/14/2012 02:17PM
Re: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) Martín Colodrero 07/14/2012 04:20PM
Re: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) Peter Lauren 07/14/2012 04:36PM
Re: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) ej ej 08/07/2012 01:20PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.