MySQL报错:Packets larger than max_allowed_packet are not all

MySQL根据配置文件会限制Server接受的数据包大小。有时候大的插入和更新会受 max_allowed_packet 参数限制,导致写入或者更新失败。

解决方法:

1.修改配置文件my.ini

max_allowed_packet = 10M

2.使用命令修改

mysql> set global max_allowed_packet = 1024*1024*10

查看是否修改成功的命令mysql> show VARIABLES like '%max_allowed_packet%';

3.设置插入或者跟新的数据包大小,比如插入500次,提交改为200次提交一次。

注意:如果命令修改无效,或者再次启动后无效,建议之间改my.conf 配置文件

posted @ 2019-07-14 13:50  酸奶加绿茶  阅读(463)  评论(0编辑  收藏  举报