I had MySQL running fine on my Mac till earlier today when I installed homebrew and also updated my Path.
When I try to run mysql from my ternimal window now, I get the following error:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
I can't connect MySQLAdmin either.
I can't even run Mysqld. The error I get when trying to run mysqld is that it can't create test file.
I also tried to telnet localhost 3306 and wasn't able to connect.
Any help would be appreciated as I am fairly new to Mac.
解决方案
Basically, all you have to do is:
Go to "System Preferences"
Then, if MySQL is installed you should see a "MySQL" icon in the "Other" section right at the bottom. Click on it.
Click on "Start MySQL Server"
You will now be able to start the MySQL command prompt without getting the "Can't connect..." error.