Category Archives: MySQL

Resolving MySQL Error 2002 on Mac OS X

The best solution seems to be from Marc Liyanage’s page: Note that it may not always be /usr/local/mysql(try using TAB completion after typing in mysql after /usr/local)

Why do I get the message
ERROR 2002: Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock’ (2)
when I try to connect to the DB using the mysql command line client?

Most likely you didn’t start up the DB server. Try this:
cd /usr/local/mysql;
sudo echo
sudo ./bin/mysqld_safe &
Then try to connect again.