Friday 24 February 2017

macos - For a newbie: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock'




I installed MySQL on Mac OS X Mountain Lion with homebrew install mysql, but when I tried mysql -u root I got the following error:




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




What does this error mean? How can I fix it?


Answer



It's probably because MySQL is installed but not yet running.




To verify that it's running, open up Activity Monitor and under "All Processes", search and verify you see the process "mysqld".



You can start it by installing "MySQL.prefPane".



Here is the complete tutorial which helped me:
http://obscuredclarity.blogspot.in/2009/08/install-mysql-on-mac-os-x.html


No comments:

Post a Comment

c++ - Does curly brackets matter for empty constructor?

Those brackets declare an empty, inline constructor. In that case, with them, the constructor does exist, it merely does nothing more than t...