my.cnf file location for MAMP on OSX (Drupal max_allowed_packet issue)

If you need to create a my.cnf file because you keep getting a max_allowed_packet error, use your favorite text editor (TextWrangler?) and create a text file at:

/Applications/MAMP/Library/my.cnf

And put the following text in the file:

[mysqld]
max_allowed_packet=32M

You can change the packet size to whatever you want so Drupal works. This usually only happens to me when I try and import a dump and the cache tables are all full. I usually empty all tables that start with ‘cache’ (including the ‘cache’ table) before I export all tables. That cuts the size of the sql file down by about 5-10x depending on your cache settings.

Of course, this post assumes you’re running a Mac with MAMP installed.

Share and Enjoy:
  • Print
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • Blogplay
  • Reddit
  • RSS
  • Technorati
  • Twitter
  • Yahoo! Buzz

Leave a Reply

You must be logged in to post a comment.