Sep 7 / Phil

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

7 Comments

leave a comment
  1. David / Dec 22 2009

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

    • Phil / Dec 22 2009

      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 / Jan 13 2010

      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.

  2. Mario / Feb 11 2010

    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

    • Phil / Feb 23 2010

      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??

  3. Mawk / Feb 24 2010

    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 / Feb 24 2010

      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.

Leave a Comment

Security Code: