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.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s