I am trying to install mysql through home brew and it successfully installs, the i run the mysql -u root (Not using a password.) and i get an error saying:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
Is mysql starting properly when you run /usr/local/bin/safe_mysqld?
If so:
Verify the /tmp/mysql.sock file exists.
If not do:
touch /tmp/mysql.sock
// With old brew recipes
safe_mysqld restart
// With new brew recipes
mysqld_safe restart
//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.*/
//From stack overflow