一、异常截图

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. 站点监控工具之uptime-kuma

    github: https://github.com/louislam/uptime-kuma [安装] docker: docker run -d --restart=always -p 3001: ...

  2. 理解Flink之四State

    在Flink的官网写着:Stateful Computations over Data Streams. 基于状态计算的数据流. 在流式计算中,希望做一些聚合分析等.那么就需要保存当前日志的状态,以备 ...

  3. AtCoder Beginner Contest 378

    Contest Link 还得加练. A & B & C & D 不具备任何思维含量. Submission A Submission B Submission C Submi ...

  4. feign 使用

    feign 是netflix 提供的申明式的httpclient调用框架 整合方法 1.添加依赖 <dependency> <groupId>org.springframewo ...

  5. Postman 汉化教程

    Postman 汉化教程(Postman中文版) 迷恋自留地 postman官网下载地址 https://www.postman.com/downloads/ postman汉化包 https://g ...

  6. 《JavaScript 模式》读书笔记(7)— 设计模式3

    这一篇,我们学习本篇中最为复杂的三个设计模式,代理模式.中介者模式以及观察者模式.这三个模式很重要!! 七.代理模式 在代理设计模式中,一个对象充当另一个对象的接口.它与外观模式的区别之处在于,外观模 ...

  7. Fiddler对手机APP进行抓包

    1.下载安装Fiddler 2.打开Fiddler菜单项Tools-> Options->HTTPS 勾选CaptureHTTPS CONNECTs,点击Actions, 勾选Decryp ...

  8. R数据分析:网状meta分析的理解与实操

    meta分析之前有给大家写过,但是meta分析只能比较两个方法.经常是被用来证明在现有研究中显示矛盾结果的干预方法到底有没有效的时候使用,通过证据综合得到某种干预到底有没有用的结论.但是如果我要证明好 ...

  9. 在 Windows 上运行 Podman: 操作指南

    在 Windows 上运行 Podman: 操作指南 https://www.redhat.com/sysadmin/run-podman-windows 2021 年 9 月的时候,我写过一篇关于如 ...

  10. mysql5.7以后group by 报错 sql_mode=only_full_group_by的解决方法

    一.发现问题 1.查询语句 SELECT * from class group by class_name; 2.报错结果 ..... this is incompatible with sql_mo ...