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 ...
随机推荐
- 洛谷P2617 Dynamic Ranking(主席树,树套树,树状数组)
洛谷题目传送门 YCB巨佬对此题有详细的讲解.%YCB%请点这里 思路分析 不能套用静态主席树的方法了.因为的\(N\)个线段树相互纠缠,一旦改了一个点,整个主席树统统都要改一遍...... 话说我真 ...
- 【Luogu3807】【模板】卢卡斯定理(数论)
题目描述 给定\(n,m,p(1≤n,m,p≤10^5)\) 求 \(C_{n+m}^m mod p\) 保证\(P\)为\(prime\) \(C\)表示组合数. 一个测试点内包含多组数据. 输入输 ...
- CTSC 选课
题面(有删减) 题目描述 学校实行学分制.每门的必修课都有固定的学分,同时还必须获得相应的选修课程学分.学校开设了N(N<300)门的选修课程,每个学生可选课程的数量M是给定的.学生选修了这M门 ...
- hadoop第一课
Hadoop基本概念 在当下的IT领域,大数据很"热",实现大数据场 景的Hadoop系列产品更"热". Hadoop是一个开源的分布式系统基础架构,由 Apa ...
- centos6.5下 hdp-2.4.2安装
(1)准备工作 /usr/sbin/sestatus -v getenforce1./usr/sbin/sestatus -v ##如果SELinux status参数为enabled即为开启状态SE ...
- JS合并两个数组的方法
JS合并两个数组的方法 我们在项目过程中,有时候会遇到需要将两个数组合并成为一个的情况.比如: var a = [1,2,3]; var b = [4,5,6]; 有两个数组a.b,需求是将两个数组合 ...
- Appserv(Apache) 配置ssl证书
一:打开httpd.conf文件,移除注释的行: Include conf/extra/httpd-ahssl.conf LoadModule ssl_module modules/mod_ssl.s ...
- org.springframework.beans.factory.BeanDefinitionStoreException错误
Bean没有被装到IOC中,多半是未加相应的Jar
- Linux/Unix 资源
Linux/Unix笔记本 初窥Linux 之 我最常用的20条命令 Linux Shell脚本教程
- 笔记:Maven 创建 Nexus 私服
首先从 http://nexus.sonatype.org/downloads/ 下载最新版本的Nexus,下载 bundle 包,不需要Web容器. windows 系统安装 目录结构说明 目录 说 ...