mysql 数据库 突然报一个
com.mysql.jdbc.PacketTooBigException: Packet for query is too large (4364521 > 4194304). You can change this value on the server by setting the max_allowed_packet’ variable
### Error updating database. Cause: com.mysql.jdbc.PacketTooBigException: Packet for query is too large (4364521 > 4194304). You can change this value on the server by setting the max_allowed_packet' variable.
### The error may involve com.xinlian.cloud.service.main.mapper.members.IAttendanceMonMapper.insertSelective-Inline
### The error occurred while setting parameters
### SQL: INSERT INTO attendance_mon ( id,user_id,event_id,event_name,adate,datas ) VALUES( ?,?,?,?,?,? )
### Cause: com.mysql.jdbc.PacketTooBigException: Packet for query is too large (4364521 > 4194304). You can change this value on the server by setting the max_allowed_packet' variable.
; ]; Packet for query is too large (4364521 > 4194304). You can change this value on the server by setting the max_allowed_packet' variable.; nested exception is com.mysql.jdbc.PacketTooBigException: Packet for query is too large (4364521 > 4194304). You can change this value on the server by setting the max_allowed_packet' variable.
2021-03-23 15:03:23.795 ERROR [-,,,] 2604 --- [pool-9-thread-5] c.x.c.s.m.services.CreateAttendanceMon [lineno:72]: CreateAttendanceMon 服务结束....
max_allowed_packet 允许通过的数据库包长度不够大 Packet for query is too large (4364521 > 4194304)
Windows 处理方案 直接找到mysql安装目录下的
ini配置文件
找到max_allowed_packet 配置10M 即可
linux 处理方案 (配置文件持久化修改):
vim /etc/my.cnf
[mysqld]
max_allowed_packet = 100M