[ubuntu-za] Can't connect to local MySQL server

Louis van der Merwe themandibleclaw at gmail.com
Wed Jan 28 10:34:52 GMT 2009


2009/1/28 Alf Stockton <alf at stockton.co.za>:
> I get :-
> ERROR 2002 (HY000): Can't connect to local MySQL server through socket
> '/var/lib/mysql/mysql.sock' (111)
> when I attempt to mysql -u root -p
>
> even though the user and password is correct and
> root at general:~# ls -al /tmp/mysql.sock
> lrwxrwxrwx 1 root root 25 2009-01-28 10:18 /tmp/mysql.sock ->
> /var/lib/mysql/mysql.sock
> root at general:~# ls -al /var/lib/mysql/mysql.sock
> -rw-r--r-- 1 root root 0 2009-01-28 11:40 /var/lib/mysql/mysql.sock
>
> please tell me what I need to fix.
>

Hi Alf,

It may be that the server died without deleting the .sock file.

do `ps -ef | grep -i mysqld` to varify that the server process is still running.

also check the mysql logs in /var/log/ which may indicate what the problem is.

regards

Louis



More information about the ubuntu-za mailing list