0

Environment

  • Mac OS Big Sur Ver 11.6
  • MAMP Ver 6.5
  • PHP Ver 7.4.21
  • MySQL Ver 14.14 Distribute 5.7.34

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).

enter image description here

What I did so far:

  1. Checked if the mysql.sock file exists.
$ ls /Applications/MAMP/tmp/mysql/
  1. Created mysql.sock file.
$ touch /Applications/MAMP/tmp/mysql/mysql.sock
  1. Tried to start mysql again. (The Error message changed from (2) to (38).)
$ mysql -u root -p
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/Applications/MAMP/tmp/mysql/mysql.sock' (38)
  1. Tried to start mysql server.
$ mysql.server start
-bash: mysql.server: command not found
  1. Checked if the path is set.
$ mysql --version
mysql  Ver 14.14 Distrib 5.7.34, for osx10.12 (x86_64) using  EditLine wrapper
  1. Used the full path
$ /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)
Takichee
  • 105
  • 1
  • 1
  • 7
  • Looks like the server is not running – Nico Haase Nov 24 '21 at 13:29
  • I think so too. That's why I used the command `$ mysql.server start`.Then I got the error `mysql.server: command not found`. So I thought mysql doesn't installed but it does. – Takichee Nov 24 '21 at 13:34
  • 1
    Could be a few issues (port, logs, path to mysql) Try the tests/solutions in these 2 links here, it might help out. [Error #2002 Can't connect to local MySQL server through socket '/Applications/MAMP/tmp/mysql/mysql.sock' (2)](https://stackoverflow.com/questions/11105796/error-2002-cant-connect-to-local-mysql-server-through-socket-applications-ma) OR [MAMP mysql server won't start. No mysql processes are running](https://stackoverflow.com/questions/16021564/mamp-mysql-server-wont-start-no-mysql-processes-are-running) – slashroot Nov 24 '21 at 14:00

1 Answers1

0

This issue was resolved by removing (just moved to trash) and reinstalling MAMP.

Takichee
  • 105
  • 1
  • 1
  • 7