mysql 报错 Caused by: com.mysql.jdbc.PacketTooBigException: Packet for query is too large

Caused by: com.mysql.jdbc.PacketTooBigException: Packet for query is too large 

出现这个错误,其实就是你拼接的sql语句太长了,因为的mysql默认接收是不能大于1M的;

解决方案:

修复my.ini(windows)文件里面的配置项 max_allowed_packet,

 

命令设置:

mysql> set global max_allowed_packet = 100 * 1024 * 1024;


 

posted on 2022-11-08 07:35  小目标青年  阅读(220)  评论(0编辑  收藏  举报