I installed MySQL on Mac OS X Mountain Lion with homebrew install mysql, but when I tried mysql -u root I got the following error:
homebrew install mysql
mysql -u root
In my case it was simply a matter of deleting a lock file.
sudo rm -f /tmp/mysql.sock.lock