If you get an error that you cannot connect to your mysql.sock file (can also be /tmp/mysql.sock on FreeBSD/Debian), then do the following:
1) check to see if the mysql.sock exists:
ls -la /var/lib/mysql/mysql.sock
2) check to see if it's some other mysql instance that has moved it somewhere else (possibly from a wrong my.cnf setting):
netstat -lnp | grep mysql
3) check to see if it's mysqld is running:
ps ax | grep mysql
3) Resart mysqld to recreate the sock file:
/etc/init.d/mysqld stop
/etc/init.d/mysqld start
4) If needed, use a brute force method (as a last resort):
killall -9 mysqld mysqld_safe
killall -9 mysqld mysqld_safe
Then type:
/etc/init.d/mysqld start
5) check /var/lib/mysql/`hostname`.err for clues. Â On FreeBSD/Debian, it's /home/mysql/`hostname`.err.