一、异常截图

com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: The last packet successfully received from the server was 46,912,998 milliseconds ago.  The last packet sent successfully to the server was 46,913,003 milliseconds ago. is longer than the server configured value of 'wait_timeout'. You should consider either expiring and/or testing connection validity before use in your application, increasing the server configured values for client timeouts, or using the Connector/J connection property 'autoReconnect=true' to avoid this problem.
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)

二、原因

连接数据库超时

三、解决方法

解决方法1:使用连接池定时刷新服务器时间戳

解决方法2:flink连接mysql时指定autoReconnect=true

即使在创建Mysql时url中加入了autoReconnect=true参数,一但这个连接两次访问数据库的时间超出了服务器端 wait_timeout的时间限制

Flink程序异常--CommunicationsException: The last packet successfully received from the server was的更多相关文章

  1. Mysql 的异常:The last packet successfully received from the server was 90 milliseconds ago. The last packet sent successfully to the server was 43,603,303 milliseconds ago. is longer than the server con

    调试一个程序, 调试到一半, 下班回家, 程序卡在了某一行, 第二天早上回来一看, 发现了异常: Wed Sep :: GMT+: WARN: Establishing SSL connection ...

  2. Cause: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: The last packet successfully received from the server was 78,050,512 milliseconds ago.

    今天访问已经架上服务器的网站,报错: Cause: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: The last packet s ...

  3. The last packet successfully received from the server was 2,926,157 milliseconds ago. The last packet sent successfully to the server was 2,926,158 milliseconds ago. is longer than the server configured value of 'wait_timeout'. 解决办法

    Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: The last packet successfully rec ...

  4. 【异常】ser class threw exception: java.sql.SQLException: The last packet successfully received from the server was 39,444 milliseconds ago. The last

    1 详细异常 ser class threw exception: java.sql.SQLException: The last packet successfully received from ...

  5. Communications link failure,The last packet successfully received from the server was *** millisecon

    使用Connector/J连接MySQL数据库,程序运行较长时间后就会报以下错误: Communications link failure,The last packet successfully r ...

  6. The last packet successfully received from the server was 20,519 milliseconds ago. The last packet sent successfully to the server was 0 milliseconds ago.

    本地升级了下MySQL的版本,从5.6升为5.7,数据文件直接拷贝的,项目查询数据库报错: Could not retrieve transation read-only status server ...

  7. The last packet successfully received from the server was 1,480 milliseconds ago.

    场景:一个上传接口,需要上传几十M的文件,文件中包含10几W的数据,然后对10+W的数据进行同步批量插入,每次批量插入1W.最后返回结果. 项目上线一段时间后,上传接口出现问题,数据库用的MySQL5 ...

  8. mysql dbcp Caused By: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: The last packet successfully received

    <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy ...

  9. 数据库连接超时:“The last packet successfully received from the server was xxx milliseconds ago”

    产生的原因:应用方的数据库连接有效期时间,大于数据库自己设置的有效期. 解决方案: 一.修改druid配置(如果使用druid的话) spring.datasource.druid.validatio ...

  10. The last packet successfully received from the server was 39,900 milliseconds ago问题解决

    1,之前用Mysql或者mycat的时候都没有这个问题.后来改为haproxy+keepalived+mycat后出现这个问题 2,网上查了很多说法,我按照网上说的改了 datasource: url ...

随机推荐

  1. python模块之sqlite3

    在Python中操作sqlite3 1)基本使用 import sqlite3 conn = sqlite3.connect('example.db') cursor = conn.cursor() ...

  2. RabbitMQ之安装与使用

    官网:https://www.rabbitmq.com/ 一. RabbitMQ 简介 MQ全称为Message Queue, 消息队列(MQ)是一种应用程序对应用程序的通信方法.应用程序通过读写出入 ...

  3. Redis原理—5.性能和使用总结

    大纲 1.导致Redis阻塞的内在原因 2.导致Redis阻塞的外在原因 3.Redis的性能总结 4.Redis缓存的相关问题 5.数据库和缓存的一致性问题 6.数据库和缓存的一致性情况列举 1.导 ...

  4. ChatGPT接口测试用例生成的流程

    通常,使用ChatGPT生成接口测试用例的流程可以分为以下关键步骤. 收集接口信息 收集接口的相关文档和信息,如接口名称.请求方法.请求参数.返回结果等.这些是ChatGPT生成测试用例需要的输入信息 ...

  5. Spring Boot整合Thrift RPC

    [转载] https://coder4.com/homs_online/spring-boot/sb-thrift.html Spring Boot自动配置简介 在介绍RPC之前,我们先来学习下Spr ...

  6. 动态改变shiro的Principal属性

    因为要保存一些用户名之外的内容在shiro中,所以创建了一个ShiroUser的类,当用户修改了某些属性后,如何动态保存到shiro中: Subject subject = SecurityUtils ...

  7. mongodb和spring集成中MongoTemplate的总结是使用方法

    基础实体类@Document(collection="person") class Person{ String id; String name; int age; public ...

  8. Qt音视频开发05-保存视频文件(yuv/h264/mp4)

    一.前言 和音频存储类似,视频的存储也对应三种格式,视频最原始的数据是yuv(音频对应pcm),视频压缩后的数据是h264(音频对应aac),由于很多播放器或者早期的播放器不支持直接播放h264文件, ...

  9. Qt编写地图综合应用29-迁徙图

    一.前言 迁徙图和上一篇的闪烁点图类似,也需要提供三个基本要素:城市名称集合.城市经纬度集合.中心点城市经纬度,至于城市点的颜色和迁徙流向箭头的颜色,都可以单独设置,echart对每个类对象都竭尽全力 ...

  10. 11.10javaweb学习