MAMP error #2006 – MySQL server has gone away

I’ve been trying to debug an error on one of the websites I developed a while back. The site in question is www.lbdscouts.org.uk the website for Letchworth & Baldock District Scouts and it was built using Concrete5.

To allow me to insert debug code I built a replica of the site on my Mac using MAMP. However, when I tried to import the database I got the following error

#2006 – MySQL server has gone away

Obviously the size of the import file was too big. The solution was simple:

Create a file called “my.cnf” file in /Applications/MAMP/conf containing the following code:

[mysqld]

max_allowed_packet = 100M

Restart the MAMP servers and the import should proceed to completion.