No such file or directory - /tmp/mysql.sock
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: mysql, Ruby On Rails, socket, symlink


September 28th, 2008 at 1:05 pm
[...] 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 [...]
October 4th, 2008 at 2:48 am
[...] | 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 [...]