How to correct ERROR 2002 (HY000): Can't connect to local MySQL server through socket /tmp/mysql.sock on Mac OS X

Oct 25, 2014 · 1 minute read · Comments
tech


I tried to install mysql using home-brew. Everything was successful But could not connect to the server. Obviously server have not started.

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

Sigh..

Following command rescued me..

mysqld stop
mysql
.server start
I found it in this stack overflow answer.
http://stackoverflow.com/questions/15016376/cant-connect-to-local-mysql-server-through-socket-homebrew

comments powered by Disqus