Skip to content

Workaround for when MAMP fails to stop or start

Last night there were several brownouts, which may or may not affected how my laptop slept. A rare sleep disorder causes problems when waking up: Right after opening my machine, it spontaneously reboots rather than, er, staying awake. This occurred only once or twice in the past year, but when it did, MAMP passed away into a zombie state. I couldn’t stop the servers; nor could I start them! Its Dashboard widget just spun and spun and spun, and I couldn’t access my local WordPress or Zenphoto installations; nor could I access the MAMP start page or phpMyAdmin. Shutting down my MacBook Pro and restarting it didn’t help either. Time to research and document the problem. >:-)

It turns out that this is a known bug, and that it’s on the MAMP developer list to fix. Even better, there’s a workaround:

  1. Start the MAMP application (something I rarely do), located in /Applications/MAMP/MAMP.app. The start page will open a new web browser page, but will fail to connect, which is expected since it’s in an unhappy state.
  2. Click the Preferences button.
  3. In the resulting Preferences sheet, don’t change anything. Just click the OK button.
  4. Results: The Apache and MySQL servers will stop and restart. Correctly, this time, rather than spinning infinitely. To make sure things are working, click the Open Start Page button; the MAMP start page should then load in a new browser page.
  5. If the Dashboard widget still continues to spin, just click its Stop Servers button, wait for the servers to stop completely, then click Start Servers.

I still use MAMP v1.7, but I’m guessing that the current version 1.7.1, released sometime late last year, also has this bug.

Before I applied the above workaround, I saw the following in the Console, while tracking systemp.log as I (unsuccessfully) attempted to stop and restart via the MAMP Dashboard widget:

2/18/08 11:11:27 AM authexec[224] executing /bin/sh
2/18/08 11:11:30 AM DashboardClient[141] apache didn’t stop -> kill
2/18/08 11:11:30 AM [0x0-0xb00b].com.apple.dock[111]
2008-02-18 11:11:30.463 DashboardClient[141:10b] apache didn’t stop -> kill
2/18/08 11:11:30 AM authexec[229] executing /bin/kill
2/18/08 11:11:30 AM [0x0-0xb00b].com.apple.dock[111] kill: 272: No such process
2/18/08 11:11:35 AM [0x0-0xb00b].com.apple.dock[111] /Applications/MAMP/Library/bin/mysqladmin: connect to server at ‘localhost’ failed
2/18/08 11:11:35 AM [0x0-0xb00b].com.apple.dock[111] error: ‘Can’t connect to local MySQL server through socket ‘/Applications/MAMP/tmp/mysql/mysql.sock’ (61)’
2/18/08 11:11:35 AM [0x0-0xb00b].com.apple.dock[111] Check that mysqld is running and that the socket: ‘/Applications/MAMP/tmp/mysql/mysql.sock’ exists!

The message about failing to connect to localhost caught my attention, and searching for those terms in the MAMP forums yielded the workaround. After things got back into a happier working condition, I skimmed to find the message below, confirming that things (or, at least MySQL) are running:

Feb 18 11:49:36 Macintosh-2 [0x0-0x26026].com.living-e.MAMP[290]: Starting mysqld daemon with databases from /Applications/MAMP/db/mysql

Sure enough, Apache, MySQL and PHP run fine now: I can use WordPress and Zenphoto again, as well as access phpMyAdmin.

9 comments

  1. Chris D wrote:

    This was hugely useful - just happened to me today! Thanks.

    Submitted on 21-Feb-2008 at 8:19 am | Permalink
  2. sairuh wrote:

    Glad it helped, Chris!

    Submitted on 21-Feb-2008 at 10:06 am | Permalink
  3. Had never experienced this until today, and was so grateful to find this. Thank you!

    Submitted on 02-Mar-2008 at 11:00 am | Permalink
  4. webchick wrote:

    Thankfully, found this post via http://www.ancientwisdompro.com/blog/archives/214 before ripping out too many clumps of my hair. Thanks SO much! :)

    Submitted on 29-Mar-2008 at 3:28 pm | Permalink
  5. IMventurer wrote:

    Thanx… MAMP stayed open I think when my MAC crashed, and I couldn’t restart Apache & MYSQL. Works perfectly now!

    Submitted on 02-Apr-2008 at 1:32 am | Permalink
  6. Chris wrote:

    Awesome. thanks!

    Submitted on 08-Apr-2008 at 5:12 am | Permalink
  7. Thankyou *so* much for posting this… I’ve had this MAMP problem repeatedly over the past couple of weeks since switching back to mac (yay) and it was driving me nuts! Feeling much better now. Aaaaahhhh.

    Submitted on 20-Apr-2008 at 12:04 am | Permalink
  8. kevin wrote:

    thanks!very useful…

    Submitted on 25-Apr-2008 at 7:30 am | Permalink
  9. Kevin R wrote:

    (not the same person as the last Kevin :)

    I have had this problem intermittently over the last year or so. I always ended up uninstalling and reinstalling MAMP to try to fix the problem. THANK YOU for this workaround as it saved me the headache of backing up all of my files before re-installing.

    Submitted on 05-May-2008 at 7:01 am | Permalink

Submit a comment

Your email is never published or shared. Required fields are marked with a red diamond, .

OpenID enabled: To use an OpenID, simply enter it in the Website field; the Name and Email fields become optional. Authentication occurs once you click the Post button to submit your comment.