MAMP | MySQL server has gone away on import large dump

Hi;

This time i try to import a customer db on a local MAMP installation, so i open terminal and paste :

/Applications/MAMP/Library/bin/mysql -u root -p db_name</paths/of/the/dump_file.sql 

On MAC, If you don’t know the path of the dump files, drug the file directly in the terminal windows, and the path magically appears..
Insert root MAMP password ( usually is root ), and….. i have an error:

” ERROR 2006 (HY000): MySQL server has gone away “

For solve it:
Go on phpMyAdmin and empty the DB, navigate to MAMP installation folder and create a custom configuration file “my.cnf” under “/application/MAMP/Library/ ” and add :


[mysqld]
max_allowed_packet=64M

Now you need to shutdown and restar mamp.
Try re import the db,( as made before on top of this article )and, if all is right, now your DB will be imported without problems.

That’s all