报错信息:
[Msg] 2006 - MySQL server has gone away
原因分析:
一般原因为sql操作的时间过长,或传送的数据过大。
默认配置为4M,考虑备份库存有大附件应该超过了此值,尝试修改配置解决该问题。
解决方法:
调整配置为150M(1024*1024*150)
mysql> show global variables like 'max_allowed_packet';
+--------------------+---------+
| Variable_name | Value |
+--------------------+---------+
| max_allowed_packet | 4194304 |
+--------------------+---------+
1 row in set, 1 warning (0.00 sec)
mysql> set global max_allowed_packet=1024*1024*150;
Query OK, 0 rows affected (0.00 sec)
mysql> show global variables like 'max_allowed_packet';
+--------------------+-----------+
| Variable_name | Value |
+--------------------+-----------+
| max_allowed_packet | 157286400 |
+--------------------+-----------+
1 row in set, 1 warning (0.00 sec)
mysql>
再次还原备份库结果:
问题解决!