Snow Leopard / MAMP Pro mySQL woes

After wiping my computer and installing 10.6 from scratch, my local php/mysql would not work at all.  The biggest problem was that I was receiving an error when trying to connect to mySQL “Lost connection to MySQL server at ‘reading initial communication packet’, system error: 61″.

It turns our that in MAMP Pro 1.8, they left out the local bind-address declaration, which for some reason freaks out the default PHP/Apache setup.

So, if you are running Snow Leopard and MAMP Pro and can’t connect to your mySQL, it’s an easy fix.  In MAMP Pro edit your my.cnf template (File > Edit Template) .  Add this line somewhere after the “[mysqld]” declaration (and reload) – Everything should be good.

bind-address = 127.0.0.1

Be Sociable, Share!

11 Comments

  • David
    December 22, 2009 - 6:46 pm | Permalink

    I was experiencing the exact same error with Snow Leopard & MAMP 1.8.4 and disabling ‘Allow local access only’ fixed the issue.

    • December 22, 2009 - 9:09 pm | Permalink

      I hadn’t tried that… make sure you are blocking the mysql ports on your firewall – and of course change the default login/pass.

    • Guy
      January 13, 2010 - 5:55 pm | Permalink

      David’s solution, plus adding the bind-address=127.0.0.1 worked for me. I’m using XAMPP for Mac OS X also. I was experiencing problems using MySQL’s Workbench in conjunction with XAMPP. I kept getting that error even though Workbench still detected that the server was running.

  • Mario
    February 11, 2010 - 3:46 pm | Permalink

    Sorry Phil, If this is not relevant to the above post, but wanted to ask, did you have any problems with js files using MAMP? My site runs fine locally but through MAMP the jquery.js files wont work. Is something wrong with the MAMP setup?

    Thanks

    • February 23, 2010 - 12:23 pm | Permalink

      Nope, no problems at all actually – this is how i do almost all of my local development. Do you have Firebug installed, are you getting any kind of errors? have you tried a straight ‘hello world’ plain javascript file??

  • Mawk
    February 24, 2010 - 4:12 am | Permalink

    The my.cnf file in 1.8.4 has “bind-address = 127.0.0.1″ in it already but I am still getting the exact same problem. It can be solved when i uncheck “Allow local access only” but I don’t really want to do that.

    Any idea what seems to be the proper solution for this?

    • Mawk
      February 24, 2010 - 4:23 am | Permalink

      I was messing around and found out that with “Allow local access only” enabled I was able to gain access using socket but not through IP address.

  • Andreas
    May 21, 2010 - 12:37 pm | Permalink

    HI all,
    I am trying to connect via my MacBook to mySQL on my iMac where MAMP is running – but no luck. Local mySQL access is working great.
    I read that I have to set the bind address to the IP of the Mac where MAMP is running but I am not able to edit the my.cnf file. When I restart MAMP it replaces the my.cnf file with the same old content and overwrites my changes.

    Anybody with a good resource on how to connect via LAN to MAMP mySQL?

    Thanks for any hint!
    Andreas

  • July 28, 2010 - 7:12 pm | Permalink

    I was experiencing the exact same error with Snow Leopard & MAMP 1.8.4 and disabling ‘Allow local access only’ fixed the issue. – I looked at it – thought \"naah\" – should\’ve known better – you just solved several hours trying to sort non-mysql connection issue –

    thanks x 1000

  • memos
    November 4, 2010 - 3:59 am | Permalink

    how i disable the local access only in snow leopard??

    • December 11, 2010 - 10:11 am | Permalink

      hey, sorry for the delay in reply – didn’t know i had comments in here… in MAMP Pro (MAMP too i think) – under servers > mysql there is a checkbox

  • Leave a Reply

    Your email address will not be published. Required fields are marked *

    * Copy This Password *

    * Type Or Paste Password Here *

    You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>