I recently installed Xampp on my mac to help with some other development work, only to find that my previous install of MySQL which I was using for Ruby on Rails development no longer worked. I was receiving errors:
ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock’
No such file or directory – /tmp/mysql.sock
To fix the problem, I added the following line to config/database.yml
Huge thanks to http://soledadpenades.com/ who had the solution.