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).的更多相关文章

  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 ...

  2. Packet for query is too large(1767212 > 1048576)mysql在存储图片时提示图片过大

    原网址:http://blog.csdn.net/bigbird2012/article/details/6304417 错误现象:Packet for query is too large(1767 ...

  3. 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 ...

  4. 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 ...

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

    原文:Mysql插入内容过长(Packet for query is too large) 这个以前一直没有碰到过,一次性向Mysql数据库插入内容过长的话会出现这个问题,解决办法就是在Mysql配置 ...

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

    有时,程序在连接mysql执行操作数据库时,会出现如下类似错误信息: Packet for query is too large (4230 > 1024). You can change th ...

  7. 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 ...

  8. 服务器的日志一直报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 ...

  9. 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 ...

随机推荐

  1. [CQOI2007]余数求和

    大于k的部分直接加k 对于小于等于k的cnt个数 ans=cnt*k - Σ(k/i * i) 然后k/i在一段区间内不变,这段区间直接可以数列求和 # include <bits/stdc++ ...

  2. js 实现table每列可左右拖动改变列宽度 【转载】

    <!DOCTYPE HTML> <html> <head> <meta charset="gbk"> <title>ta ...

  3. mvc-dispatchar-servlet.xml文件报错

    <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.sp ...

  4. 26.Django模板语言和分页

    继承 extends 子版只能继承一个父模板 1.父模板 master.html <!DOCTYPE html> <html lang="en"> < ...

  5. Jexus 5.8.3正式发布:Asp.Net Core在Linux上最友好服务器平台

    Jexus Web Serever 是一款运行于 Linux 操作系统,以支持 ASP.NET.ASP.NET CORE.PHP 为特色的高性能 WEB 服务器和反向代理服务器.最新版 5.8.3 已 ...

  6. R实战 第五篇:绘图(ggplot2)

    ggplot2包实现了基于语法的.连贯一致的创建图形的系统,由于ggplot2是基于语法创建图形的,这意味着,它由多个小组件构成,通过底层组件可以构造前所未有的图形.ggplot2可以把绘图拆分成多个 ...

  7. Python 常用命令

    对Python进行软件的安装.卸载和查看,是我们在日常工作中经常要做的事情,有的时候会突然忘记常用的命令,所以在此记录下来: pip 安装软件包 pip install xxx 卸载软件包 pip u ...

  8. CSS3 translate、transform、transition区别

    translate:移动, transform的一个方法               通过 translate() 方法,元素从其当前位置移动,根据给定的 left(x 坐标) 和 top(y 坐标) ...

  9. windows下编译caffe报错:error MSB4062: 未能从程序集 E:\NugetPackages\OpenCV.2.4.10\......的解决办法

    参考博客:http://blog.csdn.net/u013277656/article/details/75040459 在windows上编译caffe时,用vs打开后会自动加载还原NugetPa ...

  10. 详解apply

    先谈this 关于this的指向就不细说了,网上有无数博客以及you don't kown js这类书讲的已经很详细了这里就不炒冷饭了. 举几个简单的例子 function foo() { conso ...