BUGMySQL—— Packet for query is too large

Posted Johnny*

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了BUGMySQL—— Packet for query is too large相关的知识,希望对你有一定的参考价值。

mysql Text字段的大小

TINYTEXT 256 bytes
TEXT 65,535 bytes ~64kb
MEDIUMTEXT 16,777,215 bytes ~16MB
LONGTEXT 4,294,967,295 bytes ~4GB

com.mysql.jdbc.PacketTooBigException: Packet for query is too large (21982962 > 4194304). You can change this value on the server by setting the max_allowed_packet' variable.
	at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:3291)
	at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1983)
	at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2163)
	at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2624)
	at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2127)
	at com.mysql.jdbc.PreparedStatement.execute(PreparedStatement.java:1362)
	at JDBCText.textToDB(JDBCText.java:39)
	at JDBCText.main(JDBCText.java:101)

找到mysql的my.ini配置文件 修改max_allowed_packet大小
在这里插入图片描述

以上是关于BUGMySQL—— Packet for query is too large的主要内容,如果未能解决你的问题,请参考以下文章

Navicat for MySQL 还原MySQL8 备份文件提示:1153 - Got a packet bigger than ‘max_allowed_packet‘ bytes

Mysql插入内容过长(Packet for query is too large)

Mysql数据中Packet for query is too large错误的解决方法

Packet for query is too large (> 4,194,304). You can change this value on the server

Leetcode 117

Failed to connect to ESP8266: Timed out waiting for packet header