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

用mysql命令行导入大文件的时候可能遇到这样的问题,原因在于单个查询语句过长,超过max_allowed_packet以后,就会遇到这样莫名其妙的问题,解决方案两个:

1.修改查询语句,简短两个”;”之间的长度

2.修改my.cnf,max_allowed_packet = 64M估计大部分就够了,还不够就继续加大

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.