向mysql数据库导入脚本,出现错误 Got a packet bigger than 'max_allowed_packet' bytes
mysql根据配置文件会限制server接受的数据包大小。 有时候大的插入和更新会被max_allowed_packet 参数限制掉,导致失败。 查看目前配置
show VARIABLES like '%max_allowed_packet%';
显示的结果为:
max_allowed_packet 4194304 slave_max_allowed_packet 1073741824
执行:
set global max_allowed_packet=1000000000;
set global net_buffer_length=1000000;