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

Walter Leibbrandt walter+ubuntuza at translate.org.za
Wed Jan 28 11:02:49 GMT 2009


Hi,

Alf Stockton wrote:
> 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
If `netstat -tnlp | awk '$4 ~ /3306$/'` doesn't give any output, I'd 
wager that it didn't start up successfully. If it does, try and connect 
to the IP on which it listens (the part before 3306) by using the -h 
option to the MySQL command-line client.

If that helped, check the "bind-address" config option in the "mysqld" 
section in /etc/mysql/my.cnf. In my (limited) experience it tends to 
have rather paranoid defaults.

HTH

Walter

-- 
Walter Leibbrandt                  http://translate.org.za/blogs/walter
Software Developer                                  +27 12 460 1095 (w)
Translate.org.za

Recent blogs:
* Virtaal's MVCisation
http://www.translate.org.za/blogs/walter/en/content/virtaals-mvcisation
* Things that changed the way I code
* Switching from Subversion to git





More information about the ubuntu-za mailing list