- Nov
- 29
- 2007
Can’t connect to local MySQL server through socket
By: Damien McKenna | Tags:After recently reinstalling MySQL 5 on my OSX Leopard machine Rails stopped being able to connect to it - every time I’d start script/server it would say:
Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock’
After spending some time looking to see if maybe the socket file had been put in a different location I finally found the issue: MySQL wasn’t creating a socket file at all and needed to be told to do so. So, if you start receiving the above error, just make sure that the file /etc/my.cnf has the two socket lines as mentioned below, one in the [mysqld] section, the other in the [client] section:
[mysqld] bind-address = 127.0.0.1 socket=/tmp/mysql.sock [client] socket=/tmp/mysql.sockShare this post
Other posts you may enjoy
You can leave a response, or trackback from your own site.

