error 2002 (hy000): Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock

I got the issue when try­ing to con­nect to mysql from the com­mand line after doing a fresh install of mysql on my MAC and tried to con­nect to it from both — Mysql Work­bench as well as the com­mand line

The solu­tion was to just start the mysql server

Start MySQL on OSX

mysql.server start

Start MySQL on Linux

sudo /etc/init.d/mysql start

Ryan Sukale

Ryan is a UX engineer living in San Francisco, California.

You may also like...