MySQL server has gone away

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了MySQL server has gone away相关的知识,希望对你有一定的参考价值。

mysql server has gone away

场景:

mysql备份进行导入时报这个错

原因:

导入的数据过大,超过了mysql的默认大小限制

解决:

查看mysql设置:

show global variables like ‘max_allowed_packet‘;

调整mysql设置(限制大小为16G,根据需要自己调整):

set global max_allowed_packet=1024102416;

再次查看下

show global variables like ‘max_allowed_packet‘;

此时再导入就没问题了

以上是关于MySQL server has gone away的主要内容,如果未能解决你的问题,请参考以下文章

MySQL server has gone away

MySQL[Err] [Imp] 2006 - MySQL server has gone away .

MySQL server has gone away

[FireDAC][Phys][MySQL] MySQL server has gone away

MySQL server has gone away

MySQL server has gone away的解决方法