`
小抽又回来了
  • 浏览: 11050 次
  • 性别: Icon_minigender_2
  • 来自: 北京
文章分类
社区版块
存档分类
最新评论

Packet for query is too large (30,647,972 > 20,971,520). You can change this val

阅读更多

做excel 数据批量导入功能2万条数据 报错

com.mysql.cj.jdbc.exceptions.PacketTooBigException: Packet for query is too large (30,647,972 > 20,971,520). You can change this value on the server by setting the 'max_allowed_packet' variable.

; Packet for query is too large (30,647,972 > 20,971,520). 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 (30,647,972 > 20,971,520). You can change this value on the server by setting the 'max_allowed_packet' variable.] with root cause

解决方案

show VARIABLES like '%max_allowed_packet%';

 

set global max_allowed_packet = 3*1024*1024*10

 

 设置后 需要断开连接后再查询即可

 

 

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics