MYSQL-[Err] 2006 - MySQL server has gone away

MYSQL-[Err] 2006 - MySQL server has gone away

Reason: Mysql inserts multiple rows and reports an error, and the sql file imported by mysql is too large. max_allowed_packet: limit the size of the packet received by the mysql server. The
default value of the max_allowed_packet configuration is too small. After the corresponding value is increased, the import can be successful again.

View the value of max_allowed_packet

show global variables like 'max_allowed_packet';

insert image description here
Modify the value and set the value to 150M (10241024150)

set global max_allowed_packet=157286400;

Guess you like

Origin blog.csdn.net/qq_34041723/article/details/125988739