### Cause: com.mysql.cj.jdbc.exceptions.PacketTooBigException: Packet for query is too large (11,831,623 > 4,194,304). You can change this value on the server by setting the 'max_allowed_packet' variable.
; Packet for query is too large (11,831,623 > 4,194,304). You can change this value on the server by setting the 'max_allowed_packet' variable.; nested exception is com.mysql.cj.jdbc.exceptions.PacketTooBigException: Packet for query is too large (11,831,623 > 4,194,304). You can change this value on the server by setting the 'max_allowed_packet' variable.
当出现上面的异常的时候,可以参考下面的几种方案来解决:
1、修改my.cnf(一般在/etc/下,windows环境文件名 my.ini ) 文件, 在myslq 或者[mysqld] server 下配置
max_allowed_packet=20M
2、在navicat 等连接工具下 输入命令设置修改(重启mysql服务后失效)
set global max_allowed_packet=20971520
然后查看
SHOW VARIABLES LIKE '%max_allowed_packet%'