MySQL - Mac - Error 2002 - Can't connect to local... through socket

Sohrab Hejazi picture Sohrab Hejazi · May 29, 2010 · Viewed 18.3k times · Source

I had MySQL running fine on my Mac till earlier today when I installed homebrew and also updated my Path.

When I try to run mysql from my ternimal window now, I get the following error:

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

I can't connect MySQLAdmin either.

I can't even run Mysqld. The error I get when trying to run mysqld is that it can't create test file.

I also tried to telnet localhost 3306 and wasn't able to connect.

Any help would be appreciated as I am fairly new to Mac.

Answer

T.Chmelevskij picture T.Chmelevskij · Jan 23, 2016

If it's homebrew installation try:

$ mysql.server start