A blog for technology, SEO tips, website development and open source programming.

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

0 5,371

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)The post will show how to solve the above error.

MySql-sql-join-multiple-database-tables-logo-490x196Steps

– Is mysql starting properly when you run /usr/local/bin/safe_mysqld?

If so:

Verify the /tmp/mysql.sock file exists.

If not do:

mysqld stop
touch /tmp/mysql.sock

// With old brew recipes
safe_mysqld restart
// With new brew recipes
mysqld_safe restart

**Note: If mysql does not start properly after that last line:

You may need to install the tables manually using /usr/local/bin/mysql_install_db, then restart mysql

Leave a Reply

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More