MySQL server has gone away

来自linux中国网wiki
跳到导航 跳到搜索

mysql导入数据错误“ERROR 2006 (HY000): MySQL server has gone away”

后来我设置该属性,那么设置该参数值有两种设置方法,一种是直接改my.ini配置文件(永久),一种是手动在mysql命令行设置(临时)。改配置文件重启服务后是永久存在的,命令行设置只在当前服务启动有效,重启则会回归正常,如果修改后还是不够则继续加大。


MySQL [sns]> show global variables like 'max_allowed_packet';
+--------------------+----------+
| Variable_name      | Value    |
+--------------------+----------+
| max_allowed_packet | 10485760 |
+--------------------+----------+
1 row in set (0.00 sec)



set global max_allowed_packet=134217728; //此时设置为128M

https://blog.csdn.net/ron03129596/article/details/53572737

https://www.cnblogs.com/ZhangRuoXu/p/6706443.html