有时,程序在连接mysql执行操作数据库时,会出现如下类似错误信息: Packet for query is too large (4230 > 1024). You can change this value on the server by setting the max_allowed_packet' variable. 这个错误的大致原因是:向mysql数据库发送查询命令时,默认性况下,一个包的大小是1024,实际一条语句的长度,就大小这个,所以执行语句报错.解决的方式,就是调整mysq…
### 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…
今天将项目部署到linux服务器的时候莫名其妙的报一些错误,可是在本地啥错没有,通过实时查看tomcat 的日志之后发现报错是: 实时查看日志: .先切换到:cd usr/local/tomcat5/logs .tail -f catalina.out .这样运行时就可以实时查看运行日志了 发现错误: rg.springframework.dao.TransientDataAccessResourceException: ### Error querying ). You can change…
### 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 t…
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…
今天发现task微服务的error日志报如下错误: Cause: com.mysql.jdbc.PacketTooBigException: Packet for query is too large (16944839 > 16777216). You can change this value on the server by setting the max_allowed_packet' variable. 网上查了一下说要设置  max_allowed_packet    但是我查了一下…
mysql中执行sql的时候报以下错误:Packet for query is too large (1354 > 1024) 原因是mysql一次接收的报文太长,需要调整服务器参数max_allowed_packet 登录mysql,执行以下sql查看参数值: show VARIABLES like '%max_allowed_packet%'; 执行以下sql修改成20M(这里的单位是字节,所以需要进行计算): *10; 如果需要永久生效,则需要修改配置文件my.cnf,添加以下内容: ma…
今天用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. 出现问…
这个错误是由于mysql的一个系统参数max_allowed_packet设置的值过小引起的 解决这个错误的方法就是修改这个参数的值, linux系统中我们在etc目录下找到my.cnf这个文件,打开这个文件后把max_allowed_packet = 1M 中的参数值1M改为4M,如果没有这个参数那么直接添加这行max_allowed_packet = 4M 就搞定了 添加完重启mysql数据库,重启命令是service mysqld restart…
今天操作mysql的时候很郁闷,因为修改默认字符集搞了半天,终于弄成了(关于如何把windows的默认字符集设置成功,可以参看另一篇博文,最终在mysql中输入show variables like 'character%'显示的值都是utf8),而后面又出现了录入中文错误,错误信息如下: 1.  Data truncation: Data too long for column 'name' at row 1 网上搜了半天,参照http://blog.csdn.net/zoucui/artic…