一、异常截图

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框架之FastAPI

    原起: 最近项目中现存的是使用的python的异步方式进行开发, 但是只是存在脚本部分, 并没有提供对外的Web服务,正好趁机将Fastapi嵌入其中使用. 官方文档: https://fastapi ...

  2. 开源 - Ideal库 - Excel帮助类,ExcelHelper实现(五)

    书接上回,我们继续来聊聊ExcelHelper的具体实现. 01.读取Excel到DataSet单元测试 在上一章我们主要讲解了读取Excel到DataSet的三个重载方法具体实现,还没来得及做单元测 ...

  3. C++中的多线程及其之后的周边

    多线程 参考:https://zhuanlan.zhihu.com/p/613630658 平台差异:Linux 与 Windows,跨平台方案 在Linux上,有pthread的使用,而C++ 11 ...

  4. 解读GaussDB的BTree索引和UBTree索引,如何带来更强并发能力

    本文分享自华为云社区<[GaussTech技术专栏]GaussDB的BTree索引和UBTree索引>,作者:GaussDB 数据库. 1. 简介 数据库通常使用索引来提高业务查询的速度. ...

  5. LSTM学习三维轨迹的Python实现

    一.引言 长短期记忆网络(LSTM)是一种强大的递归神经网络(RNN),广泛应用于时间序列预测.自然语言处理等任务.在处理具有时间序列特征的数据时,LSTM通过引入记忆单元和门控机制,能够更有效地捕捉 ...

  6. dockerfile实现tomcat以及java的war包自动部署

    1. 下载jdk和tomcat wget https://dlcdn.apache.org/tomcat/tomcat-8/v8.5.93/bin/apache-tomcat-8.5.93.tar.g ...

  7. nodejs koa2 ocr识别 身份证信息

    1. 安装依赖 npm install baidu-aip-sdk 2.创建AipOcrClient 注:需要到百度api创建应用,拿到所需的APPID/AK/SK https://console.b ...

  8. Qt音视频开发37-识别鼠标按下像素坐标

    一.前言 在和视频交互过程中,用户一般需要在显示视频的通道上点击对应的区域,弹出对应的操作按钮,将当前点击的区域或者绘制的多边形区域坐标或者坐标点集合,发送出去,通知其他设备进行处理.比如识别到很多人 ...

  9. Java网约车项目实战:实现抢单功能详解

    在网约车项目中,抢单功能是非常关键的一部分,它决定了司机能否及时响应乘客的订单,提高整个平台的运营效率.本文将详细介绍如何使用Java来实现网约车项目的抢单功能,并提供一个完整的代码示例,以便读者能够 ...

  10. [转]CMake学习笔记(一)基本概念介绍、入门教程及CLion安装配置

    原文链接:CMake学习笔记(一)基本概念介绍.入门教程及CLion安装配置