Mailing List Archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [tlug] MySQL behaving strangely


Writing off the top of my head here, but this seems to be a not uncommon MySQL problem. IIRC historically it prefers /tmp/mysql.sock as the default, and a lot of applications still expect to find it there, but maybe the Ubuntu packagers wanted to put it somewhere more logical?

This should work as a quick'n'nasty fix:

ln -s /var/run/mysqld/mysqld.sock /tmp/mysql.sock

If Ubuntu clears the /tmp directory on reboot it won't stick though; you'll need to dig out the my.cnf file (presumably somewhere under /etc) and change the setting there (probably easier than going through all the client application settings).

Useful reference:

Ian Barwick

2008/9/16 Dave M G <>

Thanks for replying.

If it's different from /var/run/mysqld/mysqld.sock then you'll have to reconfigure
According to phpinfo(), my MYSQL_SOCKET is located at:


I also ran a whereis to see if there were any others on my system, and there weren't:

$ whereis mysqld.sock
mysqld: /usr/sbin/mysqld

The problem seems to go beyond phpMyAdmin. I can't login to Zend Platform (returns the same error), nor can I start a mysql interface from the command line:

$ mysql -u root -p
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

Does this shed any more light on the problem?

Dave M G

To unsubscribe from this mailing list, please see the instructions at

Please visit our sponsor at


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links