欢迎光临
我们一直在努力

MySQL max_allowed_packet错误解决

MySQL查询报错:

### Error querying database. Cause: com.mysql.cj.jdbc.exceptions.PacketTooBigException: Packet for query is too large (2,482 > 2,048). You can change this value on the server by setting the 'max_allowed_packet' variable. ### The error may exist in class path resource [mapper/system/SysBizProcessResultLogMapper.xml] ### The error may involve defaultParameterMap ### The error occurred while setting parameters ### SQL: select count(*) from sys_biz_process_result_log WHERE dept_id in ( ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? ) and biz_type in ( ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? ) and start_time >= ? and over_time <= ? ### Cause: com.mysql.cj.jdbc.exceptions.PacketTooBigException: Packet for query is too large (2,482 > 2,048). You can change this value on the server by setting the 'max_allowed_packet' variable. ; Packet for query is too large (2,482 > 2,048). 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 (2,482 > 2,048). You can change this value on the server by setting the 'max_allowed_packet' variable.

解决方法:设置max_allowed_packet

set global max_allowed_packet = 67108864;

除此之外,比如在Windows下,my.ini文件配置了max_allowed_packet=100M,那么你可能需要将此值进行修改。

参考:

  1. How to change max_allowed_packet size
赞(0) 打赏
未经允许不得转载:Ddmit » MySQL max_allowed_packet错误解决

评论 抢沙发

觉得文章有用就打赏一下文章作者

非常感谢你的打赏,我们将继续提供更多优质内容,让我们一起创建更加美好的网络世界!

支付宝扫一扫

登录

找回密码

注册