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
Running sudo chown _mysql /usr/local/var/mysql/* helped me finally after trying multitude of options from all these SO answers. The issue with permissions probably arose from improper shutdown of the machine.
sudo chown _mysql /usr/local/var/mysql/*