I am currently developing a Ruby on Rails (RoR) application under Ubuntu. I am using MySQL as the database and Netbeans 6.1 for developing. When I tried to access the database, I got following error:
No such file or directory - /tmp/mysql.sock
Ok, pretty straight forward. Since in Ubuntu/Debian the mysql.sock is located at /var/run/mysqld/mysqld.sock, I added
socket: ‘/var/run/mysqld/mysqld.sock’ #ubuntu/debian
to the database.yml. Trying the new configuration, gave me a new error:
rake aborted!
EMULTIHOP (Reserved)
Nice, I couldn’t understand the error message, so I started googling. Not too many useful results, but I found a blog entry that says I should use 127.0.0.1 instead of localhost. So I changed
host: localhost to host: 127.0.0.1
and I deleted the unnecessary socket entry
socket: ‘/var/run/mysqld/mysqld.sock’ #ubuntu/debian
Everything worked and the Day was saved, ready to conquer Rails
Happy coding!

Axel responded on 04 Jun 2008 at 11:54 am #
thx for that!
This saved my day
heli responded on 04 Jun 2008 at 11:39 pm #
Glad I could help
ricardo responded on 06 Jul 2008 at 5:06 pm #
thanks for that!
This saved my day too
Pradeep responded on 21 Jul 2008 at 1:14 pm #
thanx buddy , that saved my day too
Imran Lakhani responded on 24 Jul 2008 at 12:34 pm #
Thanks Partner, Saved me on my job
Arun Agrawal responded on 31 Jul 2008 at 9:00 am #
Thank you very much buddy..
This saves time for me…
Thanks
Sohail Mirza responded on 10 Aug 2008 at 6:54 am #
Thank you very much, sir. This was very helpful.
namkhanh responded on 20 Aug 2008 at 9:22 am #
thank you. very helpful. thanks again
Mariano responded on 24 Aug 2008 at 6:10 pm #
Saved me too! Thanks
Alessandro responded on 13 Sep 2008 at 9:38 pm #
Ok, it works !!!
thank you !
Jan responded on 16 Sep 2008 at 12:25 am #
I had the same problem on Red Hat with the rpm version of mysql. This solved it. Thank you!
Rosiu responded on 05 Nov 2008 at 7:55 pm #
Thanks, that helped me a lot!