This was a common problem with past versions of MAMP and it continues to happen for some users in version 4.x. Fortunately, the fix is easy. The problem is that when exiting MAMP the MySQL processes continue to run and are not stopped. This post has two solutions. The first solution of killing running processes has worked for me pretty much all the time. The second solution is from one of the comments below.
- Quit MAMP. You may have to force quit when this happens as it does not shut down correctly.
- To show any MySQL processes currently running, open Terminal and from the command prompt run the command below.
- Next, kill the MySQL processes by running the command below.
pgrep mysql | xargs kill -9
- To verify they no longer exist, pgrep for mysql again and you should not have any processes returned.
- Now Launch MAMP again and MySQL Server should start normally.
If the above solution does not work, this method should.
- Stop Mamp and kill the mysql processes as above.
- Rename the ib_logfileN (N is the log numbers) files to something else. Don’t delete these as you may need to return to them. The path to these files may be different on your system. On my system, I would do the following:
mv /Library/Application\ Support/appsolute/MAMP\ PRO/db/mysql56/ib_logfile0 /Library/Application\ Support/appsolute/MAMP\ PRO/db/mysql56/ib_logfile_0 mv /Library/Application\ Support/appsolute/MAMP\ PRO/db/mysql56/ib_logfile1 /Library/Application\ Support/appsolute/MAMP\ PRO/db/mysql56/ib_logfile_1
- Restart MAMP and MySQL should start correctly.
(Thanks to Daniel Erkalo for this alternative fix!)