MySQL server has gone away 问题的解决方法

当查询的结果集超过 max_allowed_packet 会出现这样的报错。

mysql> show global variables like 'max_allowed_packet';
+--------------------+---------+
| Variable_name      | Value   |
+--------------------+---------+
| max_allowed_packet | 1048576 |
+--------------------+---------+
1 row in set (0.00 sec)

修改参数:1024*1024*16 是16M,可以自己根据情况修改数值。

mysql> set global max_allowed_packet=1024*1024*16;
mysql> show global variables like 'max_allowed_packet';
+--------------------+----------+
| Variable_name      | Value    |
+--------------------+----------+
| max_allowed_packet | 16777216 |
+--------------------+----------+
1 row in set (0.00 sec)

 

posted on 2017-02-07 08:37  悄悄的来,匆匆的走  阅读(367)  评论(0编辑  收藏  举报

导航