mysql The last packet successfully received from t

本人博客开始迁移,博客整个架构自己搭建及编码 http://www.cookqq.com/lookBlog.action?id=c7d6978a-0dc0-4648-9020-2b81d859a243

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

时间: 2024-10-29 17:23:35

mysql The last packet successfully received from t的相关文章

mysql重连,连接丢失:The last packet successfully received from the server

原文地址:http://nkcoder.github.io/blog/20140712/mysql-reconnect-packet-lost/ 1.1 错误信息: Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: The last packet successfully received from the server was 20,820,001 milliseconds ago. The last pac

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

1.1 错误信息: Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: The last packet successfully received from the server was 20,820,001 milliseconds ago. The last packet sent successfully to the server was 20,820,002 milliseconds ago. is l

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 successfully received from the server was 78,050,512 milliseconds ago. The last packet sent successfully to the server was 78,050,512 milliseconds ago.

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 The last packet successfully received from the server was 20,519 milliseconds ago.  The last packet sent successfully to the server was 0 milliseconds

myql_链接丢失异常_mybaits _等框架_报错_The last packet successfully

mysql 8小时问题的解决方法 转发: 别看是英文 ,写的很好 ,才转 Use Hibernate + MYSQL database development, link timeout problem: com.mysql.jdbc.CommunicationsException: The last packet successfully received from the server was58129 seconds ago.The last packet sent successfull

com.mysql.jdbc.PacketTooBigException: Packet for query is too large (1169 > 1024)

### Cause: com.mysql.jdbc.PacketTooBigException: Packet for query is too large (1169 > 1024). You can change this value on the server by setting the max_allowed_packet' variable. ; SQL []; Packet for query is too large (1169 > 1024). You can change

MySQL Got a packet bigger than 'max_allowed_packet' bytes错误配置

在win7 mysql56版本导入.sql文件的时候遇到错误,代码: 1153 - Got a packet bigger than 'max_allowed_packet' bytes 终止了数据导入. 配置my.ini失败 使用命令:set global max_allowed_packet=524288000 失败 百度大都这两种方法,设置完执行show VARIABLES like '%max_allowed_packet%';始终显示max_allowed_packet  419430

MySQL Got a packet bigger than 'max_allowed_packet' bytes错误

如果将SQL单独执行会发现是Error Code:1153 Got a packet bigger than 'max_allowed_packet' bytes错误. 对于这个问题可以在my.ini中最后增加一行max_allowed_packet=16M即可(根据实际情况设置). 注意,在[client]和[mysql]部分增加无效,那个是客户端读取的参数. MySQL Got a packet bigger than 'max_allowed_packet' bytes错误

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 () that prevented it from fulfilling this request. exception org.hibernate.exception.GenericJDBCException: could not execute query org.hibernate.exce