Environment
Issue
I was using MySQL on MAMP but now having errors after restarted my mac.
First, I got this error.
$ mysql -u root -p
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/Applications/MAMP/tmp/mysql/mysql.sock' (2)
And, the Stop-icon on MAMP is orange (I think it was usually green).
What I did so far:
$ ls /Applications/MAMP/tmp/mysql/
$ touch /Applications/MAMP/tmp/mysql/mysql.sock
$ mysql -u root -p
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/Applications/MAMP/tmp/mysql/mysql.sock' (38)
$ mysql.server start
-bash: mysql.server: command not found
$ mysql --version
mysql Ver 14.14 Distrib 5.7.34, for osx10.12 (x86_64) using EditLine wrapper
$ /Applications/MAMP/Library/bin/mysql -u root -p
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/Applications/MAMP/tmp/mysql/mysql.sock' (2)
This issue was resolved by removing (just moved to trash) and reinstalling MAMP.