navcat导入mysql.sql出现:2006, 'MySQL server has gone away'

navcat导入mysql.sql出现:2006, 'MySQL server has gone away'

OperationalError (2006, ‘MySQL server has gone away’)

解决办法1: 原因是由于长时间的执行批量的MYSQL语句造成,修改/etc/my.cnf
在[mysqld]段落加入wait_timeout=90000 示例文件内容如下:

[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility package).
old_passwords=1
# 修正 OperationalError: (2006, 'MySQL server has gone away') 错误
wait_timeout=100000

  

其他省略…
然后 重启mysql服务,再次访问问题页面,没有再出现如上问题,问题得到暂时解决


其他原因

还有一些其他原因, 简单描述一下
1: mysql服务关闭
2: 数据包 过大
解决方法: 修改 max_allowed_packet 的值, 方法同上.改成16m

原文地址:https://www.cnblogs.com/achengmu/p/11151030.html