w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) when I typed "mysql"

I had this same error message for days and finally figured it out.

I had somehow gotten a my.cnf file on my computer from AMPS or possibly another MYSQL install (that I believed I had deleted).

But it turns out it was a hidden file in /etc/ that I had to manually delete. http://ianlunn.co.uk/articles/quickly-showhide-hidden-files-mac-os-x-mavericks/

Finally, I installed MySQL with homebrew one more time –– and success! It works. Also of course this time I spot a message in the homebrew setup process that points out the problem I was having:

A "/etc/my.cnf" from another install may interfere with a Homebrew-built server starting up correctly.

Hope this helps.

© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.