您的位置:首页 > 数据库 > SQL

ERROR 2006 (HY000) at line : MySQL server has gone away

2012-11-12 17:12 543 查看
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.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: