Navigation

ADS specializes in using Ruby on Rails to build advanced, scalable, database-backed web sites for organizations of all sizes. Find out more at our website.

Atlantic Dominion Solutions

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.sock
Share this post

Other posts you may enjoy

You can leave a response, or trackback from your own site.

Print This Post Print This Post

Leave a Reply