Max allowed packet problem with MAMP

Holy crud – that took a while to figure out.  I was trying to work locally on a project, and kept running into the “max_allowed_packets” error when importing the database (I was using PHPMyAdmin, but this comes up elsewhere too).  I knew that the default was 1M, but I had a hard time figuring out where to change this number.

It took me a while and a lot of attempts at difference solutions to find the answer – presented to me in a forum.  The key is to replicate the original MySQL conf file (which MAMP apparently removes) with a larger max.

Quoted below (from “weotch”) in case the link ever rots, but here is the original:

“Ok, I think I found my answer. I copied
/Applications/MAMP/Library/share/mysql/my-small.cnf to
/Applications/MAMP/db/mysql/my.cnf (notice that I renamed it). Then I
tweaked the settings I needed to in it and restarted MAMP. Golden!”


7 Responses to “Max allowed packet problem with MAMP”

  1. 1 Maureen December 14, 2008 at 10:54 am

    You rock. Thanks so much for posting this.

  2. 2 Chris February 23, 2009 at 3:26 pm

    You are the bomb – thanks!

  3. 3 Kean April 26, 2009 at 11:30 pm

    Thank you! thank you

    thank you

  4. 4 nick September 21, 2010 at 2:54 pm

    for the win

  5. 5 Josh Beauregard February 23, 2011 at 12:33 pm

    thanx for the pointer.
    However the location of /Applications/MAMP/db/mysql/my.cnf has been deprecated you may be better off moving fw to make the my.cnf file in /Applications/MAMP/Library/my.cnf

  1. 1 Max Allowed Packets Insanity « Oh Drupal… sigh Trackback on February 23, 2009 at 3:33 pm
Comments are currently closed.

%d bloggers like this: