mysql 报错Communications link failure,The last packet successfully received from the server was × mill
来源:互联网 发布:mac vim 退出编辑 编辑:程序博客网 时间:2024/06/05 13:35
1、报错信息
Communications link failureThe last packet successfully received from the server was 510,815 milliseconds ago. The last packet sent successfully to the server was 0 milliseconds ago.
2、报错原因
1、Mysql服务器默认的“wait_timeout”是8小时【也就是默认的值默认是28800秒】,也就是说一个connection空闲超过8个小时,Mysql将自动断开该connection,通俗的讲就是一个连接在8小时内没有活动,就会自动断开该连接。而应用连接池却认为该连接还是有效的(因为并未校验连接的有效性),当应用申请使用该连接时,就会导致上面的报错。2、wait timeout的值可以设定,但最多只能是2147483,不能再大了。也就是约24.85天所以即使你MySQL通过my.ini 在# The TCP/IP Port the MySQL Server will listen onport=3306下面添加# this is myown dinifition for mysql connection timeoutwait_timeout=31536000interactive_timeout=31536000无论超过最大限度多大的数值,只能被MySQL解析为2147483
3、解决方案
(1)按照错误的提示,可以在JDBC URL中使用autoReconnect属性,实际测试时使用了autoReconnect=true&failOverReadOnly=false,不过并未起作用,使用的是5.1版本,可能真像网上所说的只对4之前的版本有效。
(2)增大mysql的wait_timeout属性值;(起不到实质性作用)
show variables like '%timeout';
(3)最好的解决方法:如果使用了c3p0连接池,可以配置idleConnectionTestPeriod 属性,每多少秒检查所有连接池中的空闲连接,把该值设置的小于mysql的wait_timeout值即可
阅读全文
1 0
- mysql 报错Communications link failure,The last packet successfully received from the server was × mill
- MYSQL Communications link failure,The last packet successfully received from the server was
- Communications link failure,The last packet successfully received from the server was *** millisecon
- Communications link failure,The last packet successfully received from the server was *** millisecon
- 错误Communications link failure,The last packet successfully received from the server was的解决方法
- Communications link failure,The last packet successfully received from the server was × millisecon..
- Communications link failure,The last packet successfully received from the server was *** millisecon
- Communications link failure,The last packet successfully received from the server was *** millisecon
- MySQL: Communications link failure,The last packet successfully received from the server
- 数据库学习笔记(十)Communications link failure,The last packet successfully received from the server was
- Communications link failure The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received
- Communications link failure:The last packet sent successfully to the server was 0 milliseconds ago.
- Spring连接mysql长时间空闲报错:The last packet successfully received from the server was xx millisecond ago...
- (2)Mysql ----- The last packet successfully received from the server was *** millisecond ago.The
- mysql The last packet successfully received from the server was XXX seconds ago
- mysql超时:The last packet successfully received from the server was 172,848,658 milliseconds ago.
- mysql Communications link failure Last packet sent to the server was X ms ago
- mysql Communications link failure Last packet sent to the server was X ms ago
- Java SimpleDateFormat.setLenient(boolean lenient)方法使用
- Computer Science 领域文献检索 SCI、CPCI-S 和 EI
- LBP Library
- Python编程高级技巧| 选择好的名称
- 多库多事务降低数据不一致概率
- mysql 报错Communications link failure,The last packet successfully received from the server was × mill
- html5 百分比代替rem的方法
- 统计学习方法 第6章 逻辑斯谛回归与最大熵模型(2)
- 黑客走开系列1:Python使用元组做函数实参让代码更安全!
- 使用Putty和Xshell远程密钥认证1.9-1.12
- Oracle Order By后导分页数据重复
- linux配置ssh免密登录
- 新手通过SVN向eclipse中导入项目注意事项
- 奇异值分解SVD--简单理论