Packet for query is too large (84 > -1).
windows下的resin配置连接mysql,常用的安全的做法是将数据库信息配置到conf目录下的resin.xml文件中。
因为resin连接mysql不是必须的,所以resin本身没有提供mysql-connector的jar包,需要自己加到resin目录下的lib里面,我加了个mysql-connector-java-5.1.45-bin.jar进去,然而在运行工程执行数据库查询操作的时候,却出现了问题,报如下错误:
org.springframework.dao.TransientDataAccessResourceException: SqlMapClient operation; SQL [];
--- The error occurred while applying a parameter map.
--- Check the T_USER_INFO.selectByMap-InlineParameterMap.
--- Check the statement (query failed).
--- Cause: com.mysql.jdbc.PacketTooBigException: Packet for query is too large (84 > -1). You can change this value on the server by setting the max_allowed_packet' variable.; nested exception is com.ibatis.common.jdbc.exception.NestedSQLException:
--- The error occurred while applying a parameter map.
--- Check the T_USER_INFO.selectByMap-InlineParameterMap.
--- Check the statement (query failed).
--- Cause: com.mysql.jdbc.PacketTooBigException: Packet for query is too large (84 > -1). You can change this value on the server by setting the max_allowed_packet' variable.
只进行查询却出现Packet for query is too large,而且查询的条件只有几个字母,网上搜了很多解答,都是说需要把mysql的max_allowed_packet参数调大,但是我通过show VARIABLES like '%max_allowed_packet%';查询的结果也很大,如果是参数过小,应该是提示大于数据库中设置的packet的值,而不应该报-1。
最后发现有个帖子说是mysql-connector-javajar包的版本问题,版本不能太高,随后我将mysql-connector-java-5.1.45-bin.jar换成mysql-connector-java-5.1.26-bin.jar,不再出现packet错误,问题解决。
可能是因为我用的是ibatis2.0版本的缘故,不支持太高的mysql连接jar版本,换成mysql-connector-java-5.1.40以下版本即可解决Packet for query is too large (84 > -1)问题。
Packet for query is too large (84 > -1).的更多相关文章
- mysql Packet for query is too large (1185 > 1024)异常
注:最近mysql一直提示如下错误 Packet for query is too large (1185 > 1024). You can change this value on the s ...
- Packet for query is too large(1767212 > 1048576)mysql在存储图片时提示图片过大
原网址:http://blog.csdn.net/bigbird2012/article/details/6304417 错误现象:Packet for query is too large(1767 ...
- nested exception is com.mysql.jdbc.PacketTooBigException: Packet for query is too large (1044 > 1024
HTTP Status 500 - type Exception report message description The server encountered an internal error ...
- MySQL5中大数据错误:Packet for query is too large (****** > ******). You can change this value on the server by setting the max_allowed_packet' variable.;
使用的MySQL数据库版本:5.5 插入或更新字段有大数据时(大于1M),会出现如下错误: ### Cause: com.mysql.jdbc.PacketTooBigException: Packe ...
- Mysql插入内容过长(Packet for query is too large)
原文:Mysql插入内容过长(Packet for query is too large) 这个以前一直没有碰到过,一次性向Mysql数据库插入内容过长的话会出现这个问题,解决办法就是在Mysql配置 ...
- Mysql数据中Packet for query is too large错误的解决方法
有时,程序在连接mysql执行操作数据库时,会出现如下类似错误信息: Packet for query is too large (4230 > 1024). You can change th ...
- com.mysql.jdbc.PacketTooBigException: Packet for query is too large (1169 > 1024)
### Cause: com.mysql.jdbc.PacketTooBigException: Packet for query is too large (1169 > 1024). You ...
- 服务器的日志一直报Packet for query is too large (7632997 > 4194304). You can change this value on the server by setting the max_allowed_packet' variable.的解决方法
服务器的日志一直报Packet for query is too large (7632997 > 4194304). You can change this value on the serv ...
- Packet for query is too large (5,145 > 1,024). You can change this value on the server by setting the 'max_allowed_packet' variable.
错误 在使用Mybatis generator时提示MySQL写入过大 Packet for query is too large (5,145 > 1,024). You can change ...
随机推荐
- [Luogu3936]Coloring
Luogu sol 模拟退火呀 初始状态按顺序涂色,让同种颜色尽量放在一起. 每次随机交换两个位置,注意\(\Delta\)的计算 瞎JB调一下参数就行了 可以多做几次避免陷入局部最优解 code # ...
- [BZOJ4198] [Noi2015] 荷马史诗 (贪心)
Description 追逐影子的人,自己就是影子. ——荷马 Allison 最近迷上了文学.她喜欢在一个慵懒的午后,细细地品上一杯卡布奇诺,静静地阅读她爱不释手的<荷马史诗>.但是 ...
- 小程序 - swiper除了左右切换还有上下滚动超出屏幕的内容
本来呢,我是有专门整理小程序恶心bug的文章的,每次只要添加汇总就好, 但是呢,鉴于这个问题的恶心程度,所以我把他单独拿出来说了. ---------------------------------- ...
- java输出日志
protected final Logger logger = Logger.getLogger(User.class); logger.info("在控制台中打印的内容");
- Rotational Region CNN
R2CNN 论文Rotational Region CNN for Orientation Robust Scene Text Detection与RRPN(Arbitrary-Oriented Sc ...
- Hadoop集群环境安装
转载请标明出处: http://blog.csdn.net/zwto1/article/details/45647643: 本文出自:[zhang_way的博客专栏] 工具: 虚拟机virtual ...
- C#多线程编程(7)--锁
一提到线程同步,就会提到锁,作为线程同步的手段之一,锁总是饱受质疑.一方面锁的使用很简单,只要在代码不想被重入的地方(多个线程同时执行的地方)加上锁,就可以保证无论何时,该段代码最多有一个线程在执行: ...
- UML常用关系
转载自:http://justsee.iteye.com/blog/808799和http://www.uml.org.cn/oobject/201104212.asp 关系(4种):泛化关系,实现关 ...
- 使用c#对MongoDB进行查询(1)
1.BsonDocument对象 在MongoDB.Bson命名空间下存在一个BsonDocument类,它是MongoDB的文档对象,代表着MongoDB中不规则数据一条条实体模型.可以使用Bson ...
- NGUI_Texture
六.UITexture:在屏幕上显示一张图片,和Sprite类似,但是UITexture会单独消耗一个DrawCall去渲染, 会单独加载进内存,会增加内存的开销. 1.使用UITexture时要遵循 ...