转载:
The last packet successfully received from the server was 596,688 milliseconds ago.
后来查了一些资料,才发现遇到这个问题的人还真不少,大部分都是使用连接池方式时才会出现这个问题,短连接应该很难出现这个问题。这个问题的原因:
MySQL服务器默认的“wait_timeout”是28800秒即8小时,意味着如果一个连接的空闲时间超过8个小时,MySQL将自动断开该连接,而连接池却认为该连接还是有效的(因为并未校验连接的有效性),当应用申请使用该连接时,就会导致上面的报错。
1.按照错误的提示,可以在JDBC URL中使用autoReconnect属性,实际测试时使用了autoReconnect=true&failOverReadOnly=false,不过并未起作用,使用的是5.1版本,可能真像网上所说的只对4之前的版本有效。
2.没办法,只能修改MySQL的参数了,wait_timeout最大为31536000即1年,在my.cnf中加入:
[mysqld]
wait_timeout=31536000
interactive_timeout=31536000
重启生效,需要同时修改这两个参数。
分享到:
相关推荐
@[Android studio通过jdbc连接mysql基本步骤 以及 遇到的坑“The last packet sent successfully to the server was 0 milliseconds ago”哈哈] 小白第一次发博客哈哈,记录一下这三个晚上来我的悲惨经历以及我成功...
Cause com.mysql.jdbc.exceptions.jdbc4.CommunicationsException The last packet successfully received from the server was 47,795,922 milliseconds ago. The last packet sent successfully to the server was...
删除记录则有带条件和不带条件的`DELETE FROM`,需要注意的是,`DELETE`操作不会重置主键自增ID,而`TRUNCATE TABLE`会删除所有记录并重置ID。 查询操作是数据库操作的核心部分,`SELECT`语句用于获取数据。可以...
The last packet successfully received from the server was 56,201,339 milliseconds ago. The last packet sent successfully to the server was 56,201,339 milliseconds ago. is longer than the server ...
#### 异常概述 ...该异常通常意味着与MySQL服务器的通信出现问题,例如网络中断、服务器端主动断开连接等。 #### 异常详情 本次异常的具体描述为:“Communications link failure due to underlying exception: **...
融合多个面上光强信息的混合迭代相位恢复算法
An ISP earns its money by charging each of the the ISPs that connect to the IXP a relatively small fee, which may depend on the amount of traffic sent to or received from the IXP. 15. Google's ...
### BSD Packet Filter (BPF): 新架构下的用户级数据包捕获 #### 概述 本文档探讨了**BSD Packet Filter (BPF)**——一种新型的用户级数据包捕获架构,该架构由Steven McCanne和Van Jacobson在1992年提出,并计划...
LinuxMint加入域时的错误解决方案,包括:DNS_ERROR_BAD_PACKET、ERROR_GEN_FAILURE 0x00000001f、Unable to find ssh binary
标题:Linux 2.4网络堆栈中数据包的旅程 描述:本文档详细阐述了在Linux内核2.4.x版本中数据包在网络层的处理流程,与2.2版本相比,由于弃用了全局序列化的下半部,转而采用新的软中断(softirq)系统,整个网络...
compose up 请注意,第一次运行时,您可能会看到: mvw_flyway | The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server. (Caused by...
• Does the interface prevent a rogue application from "hijacking" the tablet, or causing dead¬locks? • Does the sharing architecture promote efficiency? 2.4 Tablet Feature Support The interface ...
This is the release notice for the PCnet Magic Packet(TM) Utility Revision 1.00 software. All files are in DOS FAT format. AMD抯 Magic Packet utility is a convenient tool for system administrators ...
The Practical Packet Analysis course is perfect for beginners to intermediate analysts, but seasoned pros will probably learn a few useful techniques too. Whether you’ve never capture packets before ...
The "ptsaplayer.dll" in the .zip package is the patch to fix the issue that Packet Tracer 7.2.2's PTSAPlayer plugin does not work on Windows 7. Apply the patch will fix the issue. Only users using...
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: The last packet successfully received from the server was 84,371,623 milliseconds ago. The last packet sent successfully to the server was 78,...
该方法不仅适用于802.11a/g的单输入单输出(SISO)速率,还扩展到了802.11n的多输入多输出(MIMO)速率。此外,该模型还可以用于优化发射功率选择和天线配置等参数,从而提高网络的整体性能。 #### 方法概述 1. **...
if the test was run a couple of times (without closing BurnInTest). Release 5.3 build 1021 WIN32 release 5 June 2008 - 32-bit BurnInTest PRO 5.3.1020 would not start on Windows 2000. This has been ...