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.

52 comments

  1. Chris D wrote:

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

    Thursday, 21 February 2008 at 8:19 am | Permalink
  2. sairuh wrote:

    Glad it helped, Chris!

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

    Sunday, 2 March 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! ๐Ÿ™‚

    Saturday, 29 March 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!

    Wednesday, 2 April 2008 at 1:32 am | Permalink
  6. Chris wrote:

    Awesome. thanks!

    Tuesday, 8 April 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.

    Sunday, 20 April 2008 at 12:04 am | Permalink
  8. kevin wrote:

    thanks!very useful…

    Friday, 25 April 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.

    Monday, 5 May 2008 at 7:01 am | Permalink
  10. kuswanto wrote:

    That’s awesome. I just got the error.

    Monday, 19 May 2008 at 11:40 pm | Permalink
  11. Francis R wrote:

    Great tip… but it didn’t work for me. I think I might have killed my MAMP Apache installation!

    I had been playing with the allow/deny directives in httpd.conf, and stopping and starting the servers quite a bit.

    Now only MySQL will start, and even with this trick, Apache refuses to do anything.

    :o(

    Does anyone have any ideas?

    Thursday, 5 June 2008 at 8:09 am | Permalink
  12. Francis R wrote:

    Me again. I’ve figured it out!

    I also checked my Console, which told me I had a syntax error in my httpd.conf file.

    I had:

    Order allow,deny
    Allow from 123.456.78.90
    Deny all

    instead of:
    Order allow,deny
    Allow from 123.456.78.90
    Deny from all

    It’s always something simpe! Time for a cup of coffee, I think.

    Thanks again for the great workaround.

    Thursday, 5 June 2008 at 8:25 am | Permalink
  13. sairuh wrote:

    Hi Francis, thanks for the tip! Especially if I find myself needing to configure the httpd.conf in MAMP.

    Thursday, 5 June 2008 at 11:28 am | Permalink
  14. Francis R wrote:

    Hi again

    I am enjoying my noob Unix adventure… I have found that it was necessary to add the subnet mask address and the localhost address to my whitelist, to make sure things work.

    So now, my directive looks like this:

    Order deny,allow
    Deny from all
    Allow from 123.456.78.90/255.255.255.0
    Allow from 127.0.0.1

    That means that only I can see stuff.

    I just need to add another “Allow from… ” line for a different IP address.

    Great!

    Friday, 6 June 2008 at 1:43 am | Permalink
  15. KC wrote:

    Big help – thank you!

    MAMP 1.7.1
    Mac OS X 10.5.3
    MacBook 2.4 GHz

    Monday, 30 June 2008 at 7:19 am | Permalink
  16. dascope wrote:

    Thank you, I was already dreading spending my afternoon on hunting a fix to this rather than doing the work I’m supposed to be doing.

    Wednesday, 2 July 2008 at 5:55 am | Permalink
  17. Adrian wrote:

    BRILLIANT!!!!!!!!! Thanks so much!

    Wednesday, 9 July 2008 at 1:12 pm | Permalink
  18. Nick wrote:

    Thanks. Worked like a charm.

    Monday, 28 July 2008 at 6:09 pm | Permalink
  19. Xilocex wrote:

    Great tip!

    Monday, 4 August 2008 at 4:10 pm | Permalink
  20. netmastan wrote:

    Thanks but didn’t work. MYSQL won’t start.

    Wednesday, 6 August 2008 at 10:00 pm | Permalink
  21. Martin Smith wrote:

    I never associated a power cut with my MAMP issue until reading your article. My MAMP is broken AGAIN for the fourth time this year, sure enough we had a power cut this morning. This workaround has saved me yet another complete re-install – thanks

    Wednesday, 13 August 2008 at 10:56 am | Permalink
  22. Phil wrote:

    Thank you! Thank you! I’ve run into this problem whenever my Mac freezes and I have had to force a restart – which is not very often, but annoying nonetheless when I restart and find that MAMP doesn’t work. My Mac just froze up today, and thanks to your tip, I was able to get MAMP back up and running again without fiddling around with it for ages.

    Monday, 13 October 2008 at 6:46 am | Permalink
  23. Ashley Ward wrote:

    This is so so useful, thank you so much!

    Thursday, 30 October 2008 at 5:31 pm | Permalink
  24. Brett wrote:

    THANK YOU! I was about to pull my hair out but this worked perfectly.

    Saturday, 8 November 2008 at 11:45 am | Permalink
  25. Audrey wrote:

    The above method did not work for me, however, I found another way. In preferences, I clicked OK, but the window would not close or do anything.

    On the dashboard widget, I clicked on the ‘i’ which allowed to choose between php5 and php4. I chose php4, then switched it back to php5. My MAMP is ok now.

    Monday, 10 November 2008 at 12:03 pm | Permalink
  26. todd wrote:

    Worked for me!!

    Wednesday, 12 November 2008 at 1:32 am | Permalink
  27. Josh mormann wrote:

    Wow!

    Thanks!

    Wednesday, 12 November 2008 at 8:39 am | Permalink
  28. giacomo wrote:

    thank you! you are the man

    Tuesday, 25 November 2008 at 8:19 am | Permalink
  29. rambo wrote:

    thanks a lot for posting this, I was about to reinstall MAMP..

    thanksss

    Monday, 29 December 2008 at 3:30 pm | Permalink
  30. Great. This was a huge help. I could not get to my dev sites and was a bit concerned, but your solution fixed it.

    Sunday, 18 January 2009 at 4:59 pm | Permalink
  31. Steve Stomp wrote:

    You’re my hero!!!

    Tuesday, 27 January 2009 at 4:40 am | Permalink
  32. thomas wrote:

    adding to the list of THANKS !

    Tuesday, 3 February 2009 at 8:39 am | Permalink
  33. Fran wrote:

    Awesome! Thanks, I knew there was a way, but this is ridiculously easy/ Thanks!

    Tuesday, 10 February 2009 at 2:36 pm | Permalink
  34. Bruno wrote:

    This is not working for me ๐Ÿ™

    Even unistalling MAMP (I Used APPDelete to be sure to remove all files and dependencies) i cannot get Apache up.
    Only MySQL starts up.

    Tried any configuration in Preferences already.

    Checked httpd.conf to match your suggestions…

    Nothing!
    Any further suggestion would be very appreciated!

    Monday, 16 March 2009 at 4:53 am | Permalink
  35. Alef wrote:

    The thank list, keeps on growing ๐Ÿ˜‰

    My thanks to you, this post saved me so much time!

    BRUNO have checked https://iwaruna.com/2006/11/05/mamp-macintosh-apache-mysql-php/ ? Maybe the instructions there will help you out

    Thursday, 19 March 2009 at 4:21 am | Permalink
  36. Tomoe wrote:

    THANKS ! Thanks ! Thanks ! My computer just did this and it was quite a stress… But I found your blog and everything is OK now. Thanks again !

    Sunday, 5 April 2009 at 9:06 am | Permalink
  37. singh wrote:

    Awesome, U saved my day baby! May be more than a day!
    Thanks a ton!

    Sunday, 12 April 2009 at 3:10 am | Permalink
  38. This is great actually knowing how to get MAMP responding again.

    MAMP locked up on me a couple of months ago and I randomly did things until it started working again. Knowing what actually worked just saved me an hour of randomly trying stuff.

    Friday, 1 May 2009 at 3:27 pm | Permalink
  39. Julien wrote:

    Tank’s a lot it saves me precious time looking to fix the bug for hours…!!!

    Thursday, 7 May 2009 at 1:06 am | Permalink
  40. Mark Law wrote:

    many thanks! your great post saved me going on a wild goose chase ๐Ÿ™‚

    Wednesday, 3 June 2009 at 12:32 am | Permalink
  41. Bri Manning wrote:

    Awesomeness, just what I was looking for…

    Sunday, 30 August 2009 at 7:35 pm | Permalink
  42. Michael wrote:

    Thank you for posting this, your headache prevented my own.

    Wednesday, 7 October 2009 at 3:21 pm | Permalink
  43. roger wrote:

    thank you for this, was sitting for hours before came across your blog

    Thursday, 4 February 2010 at 1:16 pm | Permalink
  44. Nice find! Worked straight away.

    Friday, 5 February 2010 at 8:14 am | Permalink
  45. Pete wrote:

    Very helpful thank you!!!

    Wednesday, 30 June 2010 at 3:47 pm | Permalink
  46. Rob Hartley wrote:

    Thank you! This has saved me, just when I thought I may have to re-load MAMP! Great post.

    Thursday, 5 August 2010 at 6:09 pm | Permalink
  47. Brooke wrote:

    I LOVE YOU FOR THIS. Thanks for sharing. Lifesaver.

    Wednesday, 11 August 2010 at 2:46 pm | Permalink
  48. Gman wrote:

    Just as I was ready to pull my hair out…thank you.

    Sunday, 29 August 2010 at 4:37 am | Permalink
  49. Lector wrote:

    I never comment but this time i need to do it…. THANK YOU!

    Wednesday, 29 September 2010 at 8:04 pm | Permalink
  50. gala wrote:

    Thank men!, you saved my day.

    Tuesday, 15 February 2011 at 10:38 am | Permalink
  51. Monsoon wrote:

    Thanks, your three year old post helped me when things seemed very gloomy!

    Sunday, 18 December 2011 at 1:42 pm | Permalink
  52. Noel wrote:

    If this workaround doesn’t work for you, you might just need to kill the mysqld process first. Open the MAMP application itself, then quit it to stop the Apache server if it’s still running, then open Terminal and type this:

    killall -9 mysqld

    Thank you for this tip from witheringtree.com and shaneperera.com

    Sunday, 18 March 2012 at 2:26 pm | Permalink

One Trackback/Pingback

  1. […] Iwaruna.com ยป Workaround for when MAMP fails to stop or start. […]

Submit a comment

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