原网址:http://blog.csdn.net/bigbird2012/article/details/6304417 错误现象:Packet for query is too large(1767212 > 1048576),You can change this value on the server by setting the 'max_allow_packet' variable. 解决办法:MySQL的一个系统参数:max_allowed_packet,其默认值为1048576(1…
方法2 (很妥协,很纠结的办法) 进入mysql server 在mysql 命令行中运行 set global max_allowed_packet = 2*1024*1024*10 然后关闭掉这此mysql server链接,再进入. show VARIABLES like '%max_allowed_packet%'; 查看下max_allowed_packet是否编辑成功   经验总结: 在很多台机器上用方法一都没问题,但2011年11月14日遇到一台机器死活都不成功, 使用命令行方式:…
看错误信息,发现1048576个字节,正好是1*1024*1024byte,也就是1Mb. 这正是mysql默认的max_allowed_packet值. 使用sql语句: show VARIABLES like '%max_allowed_packet%' 可以查询到相应的max_allowed_packet值 需要在/etc/my.cnf配置文件中mysqld字段下进行设置: max_allowed_packet = 20M 重启mysql服务: service mysqld restart…
场景:mybatis动态拼接,批量添加数据,因为数据太多,凭借过多,导致MySql数据库中插入大于1m的数据时,提示该异常. 解决办法:修改mysql的属性 max_allowed_packet即可. 修改办法:打开mysql的根目录,找到my.ini文件,再文件的[mysqld]下面添加一行max_allowed_packet = 20M,保存之后重启mysql即可.…
使用的MySQL数据库版本:5.5 插入或更新字段有大数据时(大于1M),会出现如下错误: ### Cause: com.mysql.jdbc.PacketTooBigException: Packet for query is too large (1132484 > 1048576). You can change this value on the server by setting the max_allowed_packet' variable. ; SQL []; Packet fo…
HTTP Status 500 - type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception org.hibernate.exception.GenericJDBCException: could not execute query org.hibernate.exce…
### Cause: com.mysql.jdbc.PacketTooBigException: Packet for query is too large (1169 > 1024). You can change this value on the server by setting the max_allowed_packet' variable. ; SQL []; Packet for query is too large (1169 > 1024). You can change…
服务器的日志一直报Packet for query is too large (7632997 > 4194304). You can change this value on the server by setting the max_allowed_packet' variable.的解决方法 最近服务器上的项目老是频繁的就崩掉了,重启之后过了一晚第二天来就又挂了,查看tomcat的日志有报内存溢出的错误,还有报Packet for query is too large (7632997 >…
今天将项目部署到linux服务器的时候莫名其妙的报一些错误,可是在本地啥错没有,通过实时查看tomcat 的日志之后发现报错是: 实时查看日志: .先切换到:cd usr/local/tomcat5/logs .tail -f catalina.out .这样运行时就可以实时查看运行日志了 发现错误: rg.springframework.dao.TransientDataAccessResourceException: ### Error querying ). You can change…
今天用java写了批量插入运行时,报错: Error updating database.  Cause: com.mysql.cj.jdbc.exceptions.PacketTooBigException: Packet for query is too large (1,399,241 > 1,048,576). You can change this value on the server by setting the 'max_allowed_packet' variable. 出现问…