No such file or directory - /tmp/mysql.sock

No Gravatar

Today I started messing around with Rails again, after having spent the best part of the last months on Merb.

Anyway the common link problem for the mysql adapter reared its ugly head as usual.
No such file or directory - /tmp/mysql.sock

The solution to this is to create a symbolic link from your mysqld.sock to /tmp/mysql.sock

But where is your mysqld.sock?

For Mac OSX it is usually in /opt/local/var/run/mysql5/mysqld.sock.
Check where it is with locate.

locate mysqld.sock

Now create the symlink:
ln -s /link/to/where/mysqld.sock /tmp/mysql.sock
on my Mac, I ran:
ln -s /opt/local/var/run/mysql5/mysqld.sock /tmp/mysql.sock

Tags: , , ,

2 Responses to “No such file or directory - /tmp/mysql.sock”

  1. Recent Faves Tagged With "tmp" : MyNetFaves Says:

    [...] public links >> tmp No such file or directory - /tmp/mysql.sock First saved by netmouse | 1 days ago Webinar: The Social Graph First saved by Yooksxtve | 4 [...]

  2. User links about "tmp" on iLinkShare Says:

    [...] | user-saved public links | iLinkShare 4 votesNo such file or directory - /tmp/mysql.sock>> saved by Emowanab 2 days ago1 votesFake IE 7.0 Update: Full Analysis>> saved by emodemon21 4 days [...]

Leave a Reply

You must be logged in to post a comment.


nogeek.org is Digg proof thanks to caching by WP Super Cache!