3

Mamp servers won't start it seems apache will but mysql won't. I really have no idea what I need to do to resolve this. Please help.

4 Answers4

12

Something similar happened to me, I hope that what has helped me, will also help you.

I just upgraded MAMP from 4.06 to 4.1, and, mysteriously, it has suddenly stopped working access to phphMyAdmin, with this error:

#2002 - No such file or directory - The server is not responding (or the local server's socket is not correctly configured).

After much reading and testing, this has finally been the answer that has worked for me: phpmyadmin - error 2002 - on Mac

Steps:

  1. Locate config.inc.php file. You can find it in /Applications/MAMP/bin/phpMyAdmin

  2. Edit it, using some text editor (Sublime 2, TextEdit, Text Wrangler,...)

  3. Locate this text: $cfg['Servers'][$i]['host'] = 'localhost';

  4. Replace localhost with 127.0.0.1

    $cfg['Servers'][$i]['host'] = '127.0.0.1';
    
  5. Save it and close.

  6. Restart servers (or stop and start), or just start them.

  7. Try to access to phpMyAdmin.

It has worked for me, I hope for you too.

Community
  • 1
  • 1
guillermoig
  • 121
  • 2
6

Simply remove two files ib_logfile0 and ib_logfile1 from /Applications/MAMP/db/mysql56

Hasan Zahran
  • 1,364
  • 16
  • 14
  • 1
    make sure you start up mysql after you delete the logfiles – Jade Mar 08 '20 at 03:02
  • 1
    The above solution fixed everything after restarting MAMP. Some solutions are for when sql does start up. This one fixed my issues of the sql checkbox not lighting up green and giving the error 2002. – 6754534367 Mar 17 '20 at 11:55
2

I researched and found 2 (rather 3) solutions for this particular issue wherein Apache would start but MySQl would not. They were 1. Changing localhost to 127.0.0.1 2. Renaming the ib_logfile# to ib_logfile_# 3. Killing existing mysqld process

While none of the above approaches worked; what worked instead was the following

Surprisingly when MAMP was installed, it did not create mysql_error_log.err file under /Applications/MAMP/logs folder. I created this file under the same directory and MySQL service turned green in MAMP window. I found this file missing when I was attempting to start MySQL service directly using the bash script 'startMysql.sh' inside /Applications/MAMP/bin

Ra-one
  • 21
  • 2
1

Can add another cause to the problem. Since all other answers did not work for me, I took a further look into mysql_error_log.err file at /Applications/MAMP/logs folder and found the following:

[ERROR] Another process with pid 1083 is using unix socket file.
[ERROR] Unable to setup unix socket lock file.
[ERROR] Aborting

So my guess is, that somehow there was an old process of mysql stuck while shutting down the server.

Restarting my mac solved the problem, but it should also work if you kill the named process (in my case pid 1083) with:
sudo kill -1083 PID

Alex Berger
  • 1,357
  • 1
  • 10
  • 22