com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
来源:互联网 发布:陌生人社交软件 编辑:程序博客网 时间:2024/05/21 17:00
错误:
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failureThe last packet successfully received from the server was 40,472 milliseconds ago. The last packet sent successfully to the server was 2 milliseconds ago. at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)····················Caused by: java.io.EOFException: Can not read response from server. Expected to read 4 bytes, read 0 bytes before connection was unexpectedly lost. at com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:3011) at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:3469) ... 121 more
原因是:mysql配置文件中添加了一句:
修改MySQL配置文件/etc/my.cnf,设置成 wait_timeout=5
注意:这里的时间单位是5s,而默认的是8个小时才会过期,所以会报上面的错误,改大一点就可以了或者干脆删掉使用默认的。
阅读全文
0 0
- com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
- 解决com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
- com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
- 解决com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
- com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
- com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
- com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
- com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
- com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
- com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure 解决办法
- com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
- com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
- com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
- com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
- com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
- Cause: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
- com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
- com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
- 润乾连oracle集群的简易写法
- 走迷宫
- PAT乙级1027. 打印沙漏(20)
- MFC制作截图软件中的半透明界面
- 局部最小元素
- com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
- React入门笔记(二):组件和AJAX
- 服务器VPN配置教程(3)——纯shell启动
- EventBus从应用到源码分析
- Java 基础
- 初步认识并查集
- java基础
- git学习(1)
- Postgresql新建数据库