ERROR 2006 (HY000) at line : MySQL server has gone away
While using a script to overwrite my local database with the Prod database, I ran into this error:
ERROR 2006 (HY000) at line 27652: MySQL server has gone away
Some Google-fu indicated that it was a timeout problem. I found information on fixing it online, but none of it applied to my setup -- I'm running MAMP Pro 2. To work things out on my local installation, I took the following steps:
- Opened up the MAMP Pro application and stopped the servers.
- Opened File > Edit Template > MySQL my.cnf.
- Changed max_allowed_packet = 1M to max_allowed_packet = 64M under [mysqld].
- Added wait_timeout = 6000 under [mysqld].
- Changed max_allowed_packet = 16M to max_allowed_packet = 64M under [mysqldump].
- Saved the template.
- Restarted the MAMP Pro servers.
I haven't tested different variations of these updates, so I'm not sure if both wait_timeout and the max_allowed_packet updates were necessary. But after the updates above, the error was gone.
浙公网安备 33010602011771号