mysql服务器最近老是报错,内容如下:

The last packet successfully received from the server was 65,502,275 milliseconds ago. The last packet sent successfully to the server was 65,502,276 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.

主要的意思是:: 数据库有长连接,由于长时间没有使用,并且空闲时间超过了wait_timeout设置的时间。 数据库到了wait_timeout设定的时间,自动释放了链接。

客户端还有这个长连接,客户端使用这个长连接向mysql数据库发送消息,可是这个链接数据库服务器端已经释放了,所以爆出上面的错误.

如果你刚好在数据库超时的第一时间内看到日志记录的话那么,第一次超时发生的错误就是这样的:

ERROR [org.hibernate.util.JDBCExceptionReporter] - Communications link failure

Last packet sent to the server was 0 ms ago.

如果不是第一次超时后执行,以后每次报错就变成嵌套的错误了,就是下面这样:

ERROR [org.hibernate.util.JDBCExceptionReporter] -

No operations allowed after connection closed.Connection was implicitly closed due to underlying exception/error:

解决办法:由于项目中代码比较多,查找哪一个长连接没有释放很麻烦,过程如下:

(1)查看报错日志的详细信息,看关系到哪一个dao类出现的问题

(2)然后将mysql连接池最大、最小数据设置成3,1.

(3)然后打开3个浏览器,进行操作

(4)发现项目确实很慢,然后详细看了一下代码,确实由于一个地方连接池没有关系,导致链接一直存在,没有释放。

更多信息请查看IT技术专栏

mysql报错last packet_mysql The last packet successfully received相关推荐

  1. idea连接MYSQL报错汇总

    idea连接MYSQL报错汇总 [The last packet sent successfully to the server was 0 milliseconds ago.The driver h ...

  2. mysql重连,连接丢失:The last packet successfully received from the server--转载

    原文地址:http://nkcoder.github.io/blog/20140712/mysql-reconnect-packet-lost/ 1.1 错误信息: Caused by: com.my ...

  3. The last packet successfully received from the server was 1,547,682,071 milliseconds ago. The last

    MySQL 经常出现这样的错误: org.springframework.dao.DataAccessResourceFailureException:   PreparedStatementCall ...

  4. server 2008 mysql 报错 0xc000007b_这十个MySQL经典错误,99%的程序员一定遇到过!你呢?...

    今天就给大家列举 MySQL 数据库中,最经典的十大错误案例,并附有处理问题的解决思路和方法,希望能给刚入行,或数据库爱好者一些帮助,今后再遇到任何报错,我们都可以很淡定地去处理.学习任何一门技术的同 ...

  5. datagrip连接mysql报错[08S01]

    datagrip连接mysql报错[08S01] Failed [08S01] Communications link failure The last packet sent successfull ...

  6. mysql 报错 get error 28 from storage engine 解决方法

    mysql 报错 get error 28 from storage engine 解决方法 参考文章: (1)mysql 报错 get error 28 from storage engine 解决 ...

  7. Mysql报错Fatal error:Can't open and lock privilege tables

     Mysql报错Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist 安装mysql后 ...

  8. 登录mysql报错2059,navicat连接mysql报错2059如何解决

    navicat连接mysql报错2059,如下图所示: 网上查询过后,发现这个错误出现的原因是在mysql8之前的版本中加密规则为mysql_native_password,而在mysql8以后的加密 ...

  9. python怎么捕获mysql报错

    一.前言 最近在运行python脚本的时候,经常出现:mysql server has gone away的错误,导致脚本停止运行.只是代码里面明明已经使用try: except 这种方式来捕获mys ...

最新文章

  1. 《云数据管理:挑战与机遇》2.3.3 恢复和提交
  2. c语言 sysinfo_操作系统:内存分配(C语言 winapi)
  3. Linux下LCD 10分钟自动关屏的问题总结
  4. 【Node】模块加载过程
  5. 【已解决】“The import java.sql.Connection conflicts with a type defined in the same file“
  6. 没有收到回复的同学注意了,用它一键查询!
  7. 【HDU - 1540】 Tunnel Warfare (线段树进阶操作 区间合并+ 单点更新+ 最长覆盖区间查询 )
  8. 连续整数的和(51Nod-1138)
  9. DirectAccess部署(四)之双网卡环境 客户端连接测试(多图!)
  10. Unable to get the focused window from device - android
  11. Proxy Hosted Virtual
  12. 开源监控系统Prometheus介绍
  13. 将多个文件绑在一起执行
  14. 常用matlab画图命令 坐标轴倾斜
  15. c语言之图形编程 pdf,《C语言图形编程》.pdf
  16. 基于vue开发一个组件库
  17. opensuse13.1 安装 SqliteMan
  18. 微信html5线上卡券,16.7.1HTML5网页领取卡券
  19. 技术问答网站与论坛为什么半死不活
  20. 植物大战僵尸修改关卡及金币

热门文章

  1. 服务器装系统用哪个好,服务器系统重装用哪个系统
  2. matplotlib调节colorbar的大小
  3. python对Excel的操作 xlrd、xlwt包详解
  4. Spring的@Resource注解报java.lang.NoSuchMethodError
  5. 三层神经网络实现手写数字的识别(基于tensorflow)
  6. 傅里叶变换频谱的可视化保存
  7. Android之网络编程
  8. JavaScript 中的 require / exports、import / export、浅谈JavaScript、ES5、ES6
  9. SpringBoot 自带工具类~断言
  10. Java消息服务~消息属性