数据库文件过大异常及解决方案

来源:互联网 发布:企业内部网络建设 编辑:程序博客网 时间:2024/05/16 09:27
### Cause: com.mysql.jdbc.PacketTooBigException: Packet for query is too large (10485836 > 4194304). You can change this value on the server by setting the max_allowed_packet' variable.; SQL []; Packet for query is too large (10485836 > 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 (10485836 > 4194304). You can change this value on the server by setting the max_allowed_packet' variable.

修正方案

MySQL的一个系统参数:max_allowed_packet,其默认值为1048576(1M),
查询:
show VARIABLES like '%max_allowed_packet%';

100M

set global max_allowed_packet = 100*1024*1024

0 0
原创粉丝点击