欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

com.mysql.cj.jdbc.exceptions.PacketTooBigException: Packet for query is too large

程序员文章站 2022-04-04 20:32:31
...

提示错误:
com.mysql.cj.jdbc.exceptions.PacketTooBigException: Packet for query is too large

原因:数据包太大

解决:

更改mysql限制sql数据包大小即可

  1. 进入mysql
mysql -uroot -p

com.mysql.cj.jdbc.exceptions.PacketTooBigException: Packet for query is too large

  1. 查询mysql当前配置信息
show VARIABLES like '%max_allowed_packet%';

com.mysql.cj.jdbc.exceptions.PacketTooBigException: Packet for query is too large

  1. 设置数据包大小
set global max_allowed_packet = 2*1024*1024*10;

com.mysql.cj.jdbc.exceptions.PacketTooBigException: Packet for query is too large