• 0

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

I got the issue when trying to connect to mysql from the command line after doing a fresh install of mysql on my MAC and tried to connect to it from both - Mysql Workbench as well as the command line The solution was to just start the mysql server Start MySQL on OSX

mysql.server start
Start MySQL on Linux
sudo /etc/init.d/mysql start