今天发现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    但是我查了一下现在已经是100M了

show variables like '%max_allowed_packet%'

然后我重启mysql和重启task微服务还是报这个错,后来又有个文章说要设置 mysql 连接的url 加上

&useServerPrepStmts=true&maxAllowedPacket=104857600

然后我重启了task微服务又报另外一个错,如下

2019-11-08 12:53:19.580 pool-9-thread-25 ERROR com.hp.nova.common.tasksync.tcscheduler.TcFileProcessScheduleJob.fileProcessCronJob(TcFileProcessScheduleJob.java:354) - org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.type.TypeException: Could not set parameters for mapping: ParameterMapping{property='__frch_i_8241.stepStatus', mode=IN, javaType=class java.lang.Integer, jdbcType=null, numericScale=null, resultMapId='null', jdbcTypeName='null', expression='null'}. Cause: org.apache.ibatis.type.TypeException: Error setting non null for parameter #24726 with JdbcType null . Try setting a different JdbcType for this parameter or a different configuration property. Cause: java.sql.SQLException: Parameter index out of bounds. 24726 is not between valid values of 1 and 24725

如果改成只加如下一个配置,就还是不生效

maxAllowedPacket=104857600

后面没办法没找到原因为什么max allowed packet设置了task微服务还是报错不能超过16M,后面只能修改了源代码把批量update的语句改成了每1000条update一次解决了问题

 
 

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

  1. Linux服务器上日志报com.mysql.jdbc.PacketTooBigException: Packet for query is too large (1783 > 1024). You can change this value on the server by setting the max_allowed_packet' variable.

    在做查询数据库操作时,报了以上错误,还有out of memery heap hacp ,原因是MySQL的max_allowed_packet设置过小引起的,我一开始设置的是1M,后来改为了20M ...

  2. com.mysql.jdbc.PacketTooBigException: Packet for query is too large (1680 > 1024). You can change this value on the server by setting the max_allowed_packet' variable.

    这个错误是由于mysql的一个系统参数max_allowed_packet设置的值过小引起的 解决这个错误的方法就是修改这个参数的值, linux系统中我们在etc目录下找到my.cnf这个文件,打开 ...

  3. 问题: Packet for query is too large (1786 > 1024). You can change this value on the server by setting the max_allowed_packet' variable.

    错误描述: 今天在手机端查看之前上线的项目时,突然报了下面的错误.再之后用电脑登陆,其他设备登陆都一直报这个错误. 错误信息: ### Error querying database. Cause: ...

  4. MYSQL Packet for query is too large (12054240 > 4194304). You can change this value on the server by setting the max_allowed_packet' variable.

    MYSQL Packet for query is too large (12054240 > 4194304). You can change this value on the server ...

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

  6. Mysql报错:Packet for query is too large (1121604 > 1048576).You can change this value on the server by setting the max_allowed_packet variable

    看错误信息,发现1048576个字节,正好是1*1024*1024byte,也就是1Mb. 这正是mysql默认的max_allowed_packet值. 使用sql语句: show VARIABLE ...

  7. mysql Packet for query is too large (2036 > 1024). You can change this value on the server by setting the max_allowed_packet' variable.

    解决方法: 打开控制台,输入下面语句,执行 set global max_allowed_packet = 20*1024*1024; 网上说要重启 mysql server, 我是执行完后不用重启就 ...

  8. Packet for query is too large (1660 > 1024). You can change this value on the server by setting the max_allowed_packet' variable.

    原因是mysql 默认允许的 数据报包 是 1M  设置大一些就可以了 centos 下面  /ect/my.cnf 文件里面 加入或者修改 下面的参数 [mysqld] max_allowed_pa ...

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

随机推荐

  1. django模型多对多调用

    对于如下的模型: from django.db import models # Create your models here. class Student(models.Model): name = ...

  2. 36 Flutter仿京东商城项目 用户登录 退出登录 事件广播更新状态

    Login.dart import 'dart:convert'; import 'package:dio/dio.dart'; import 'package:flutter/material.da ...

  3. 123456---com.twoapp.ErTongNongChangPinTu---儿童农场拼图

    com.twoapp.ErTongNongChangPinTu---儿童农场拼图

  4. MySQL数据库表的设计和优化(上)

    一.单表设计与优化: (1)设计规范化表,消除数据冗余(以使用正确字段类型最明显):数据库范式是确保数据库结构合理,满足各种查询需要.避免数据库操作异常的数据库设计方式.满足范式要求的表,称为规范化表 ...

  5. 原创:Mac AppleScript 自动登录两个QQ

    前提,已有登录过的账号,且没有设置为自动登录 tell application "QQ" activate tell application "System Events ...

  6. 使用PowerCLI给ESXi批量设置时间和配置NTP

    在现代的各种业务系统中,时间同步很重要.现在VMware的虚拟化解决方案应用非常广泛,给ESXi宿主机一个统一准确的时间,也给客户机系统一个准确的时间. 生产环境中主机数量少的话倒是可以手动设置,但是 ...

  7. Python爬取链家二手房源信息

    爬取链家网站二手房房源信息,第一次做,仅供参考,要用scrapy.   import scrapy,pypinyin,requests import bs4 from ..items import L ...

  8. boost::bind四种应用场景的例子

        普通函数 int f( int a, int b ){return a + b;}boost::bind( f, _1, 9 )( 1 ) 成员函数 struct demo{int f( in ...

  9. Java与计算机常识

    DB2   IBM公司的数据库 Oracle  Orcle的数据库 Mysql    数据库(免费) 1.  jetty    小型服务器(类似于tomcat) Jetty 是一个开源的servlet ...

  10. 2019ICPC南昌网络赛总结

    打的很崩的一场比赛.上来签到题我就wa了一发,感觉在梦游.然后我开了H题,队友开B题,f(n)=3f(n-1)+2f(n)傻子都知道矩阵快速幂,但是1e7的强制在线必须把logn优化,然后试图打表寻找 ...