Communications link failure,The last packet successfully received from the server was *** millisecon
来源:互联网 发布:周扬青淘宝店铺货源 编辑:程序博客网 时间:2024/06/05 14:37
使用Connector/J连接MySQL数据库,程序运行较长时间后就会报以下错误:
Communications link failure,The last packet successfully received from the server was* **millisecond ago.
The last packet successfully sent to the server was * **millisecond ago。
其中错误还会提示你修改wait_timeout或是使用Connector/J的autoReconnect属性避免该错误。
后来查了一些资料,才发现遇到这个问题的人还真不少,大部分都是使用连接池方式时才会出现这个问题,短连接应该很难出现这个问题。这个问题的原因:
按照错误的提示,可以在JDBC URL中使用autoReconnect属性,实际测试时使用了autoReconnect=true&failOverReadOnly=false,不过并未起作用,使用的是5.1版本,可能真像网上所说的只对4之前的版本有效。
没办法,只能修改MySQL的参数了,wait_timeout最大为31536000即1年,在my.cnf中加入:
[mysqld] wait_timeout=31536000 interactive_timeout=31536000
- 1
重启生效,需要同时修改这两个参数。
Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure [09:49:36.821] [09:49:36.821]Last packet sent to the server was 0 ms ago.
阅读全文
0 0
- 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..
- 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的解决方法
- MYSQL Communications link failure,The last packet successfully received from the server was
- mysql 报错Communications link failure,The last packet successfully received from the server was × mill
- 数据库学习笔记(十)Communications link failure,The last packet successfully received from the server was
- MySQL: Communications link failure,The last packet successfully received from the server
- 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.
- (2)Mysql ----- The last packet successfully received from the server was *** millisecond ago.The
- The last packet successfully received from the server was XXX seconds ago
- mysql The last packet successfully received from the server was XXX seconds ago
- 彻底解决"The last packet successfully received from the server was * milliseconds ago"问题
- The last packet successfully received from the server was 78,682,686 milliseconds ago
- The last packet successfully received from the server was 30,516,920 milliseconds ago.
- 基于神经卷积网络的人脸识别
- 2017 Multi-University Training Contest
- ubuntu 安装pytorch
- A + B Again HDU
- mvn常用命令
- Communications link failure,The last packet successfully received from the server was *** millisecon
- E
- 如何用intellij idea新建一个java web+Servlet项目
- 7月25日云栖精选夜读:刷脸out了?阿里“刷脚购物”亮相CVPR 2017
- mysql case when 中可以使用and
- Google Instant Apps VS 微信小程序
- java.lang.ArrayIndexOutOfBoundsException(数组越界)处理方法
- 未来10年,最夯的行业大汇总,有你的职位吗?
- Convolutional Neural Network