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

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-08
  • 2021-10-03
  • 2022-12-23
  • 2021-12-16
  • 2022-12-23
猜你喜欢
  • 2019-07-16
  • 2021-07-21
  • 2022-12-23
  • 2021-06-08
  • 2021-09-14
  • 2022-01-08
  • 2021-08-02
相关资源
相似解决方案