Error querying database. Cause: com.mysql.cj.jdbc.exceptions.PacketTooBigException: Packet for query is too large (1,063 > 1,024). You can change this value on the server by setting the 'max_allowed_packet' variable.
MYSQL会根据配置文件会限制server接受的数据包大小。
有时候在大的插入和更新会被max_allowed_packet参数限制掉,导致失败
执行SQL语句,查看大小:
show variables like '%max_allowed_packet%';
更改大小方法:
set global max_allowed_packet = 2*1024*1024*10;(20M)
经测试根据sql设置最大为4M
需要在/etc/my.cnf 设置
max_allowed_packet = 20M
重启mysql后生效