Saturday, February 21, 2015

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

I was able to connect to the server using SQL Pro but not from the command line. The solution:

$ mysql -h -P 3306 -u root -p

You can also use telnet to check the connectivity:

$telnet 3306
Connected to localhost.
Escape character is '^]'.
5.6.21 81/8j0O?Am$fZn<||}~!mysql_native_password

!#08S01Got packets out of orderConnection closed by foreign host.