I’ve gotten this error on both ubuntu and mac osx.
Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (2)
Simple quick fix solution is to create a symbolic link to it. The location i’ve seen it other than /var/run/mysqld is /tmp/mysql.sock
sudo ln -s /tmp/mysql.sock /var/run/mysqld/mysqld.sock