报错信息:
com.mysql.jdbc.PacketTooBigException: Packet for query is too large (1347 > 1024). You can change this value on the server by setting the max_allowed_packet' variable
原因:
MySQL根据配置文件会限制Server接受的数据包大小。有时候插入、更新或查询时数 据包的大小,会受 max_allowed_packet 参数限制,导致操作失败。
解决:
查看: SHOW VARIABLES LIKE '%max_allowed_packet%'
方法一:
可以编辑my.cnf来修改(windows下my.ini),在[mysqld]段新增
max_allowed_packet = 20M
方法二:
更改命令: SET GLOBAL max_allowed_packet = 210241024*10
注意:此方法,如果重启mysql服务,max_allowed_packet的值会还原成默认的初始值,命令行里设定的值不会生效。
相关文章
- 12-30mybatis使用map传递多参数报错:A query was run and no Result Maps were found for the Mapped Statement
- 12-30获取iTextSharp 的image 报错
- 12-30pytest文档8-html报告报错截图+失败重跑
- 12-30在启动dubbo框架时报错。Unable to connect to zookeeper server within timeout: 5000
- 12-30[已解决]报错: Error response from daemon: conflict
- 12-30Docker:删除images报错(Error response from daemon: conflict: unable to delete 6885a5e3712a (must be forced) - image is being used by stopped container 0cf27d7d29c7)
- 12-30npm install报错:integrity checksum failed when using sha1
- 12-30git clone 报错Unable to negotiate with xxx.xxx.xxx.xxx port 12345: no matching key exchange method fou
- 12-30安卓的webview报错
- 12-30eclipse中使用pull报错(git提交冲突)