您好,欢迎访问一九零五行业门户网

2006 – MySQL Server has gone away error during database imp_MySQL

i was trying to import a relatively large database into mysql via phpmyadmin, and i was hit with the error message 2006 – mysql server has gone away :
why has the server gone away? lol. thinking it was bound to be something like a size limit ( not the first time this has happened to me ), i ran some simple sql to print out the mysql configuration variables:
show variables;
in the resulting list, look for max_allowed_packet :
if you convert 1048576 bytes into something perhaps more meaningful, such as mb, you’ll find it’s a low 1mb. well, that’s certainly not a big enough limit for the database sql i’d tried to import.
edit the mysql my.cnf file so to increase this limit, i located the my.cnf file, which mamp uses as part of the mysql configuration setup:
sudo nano /etc/my.cnf
and added a new value to the end of the file:
max_allowed_packet = 64m
thanks to this article for helping me understanding how to update the mysql settings for mamp , and this answer on stackoverflow for helping me understand why i was received the 2006 sql error.
其它类似信息

推荐信息