mysql: Communications link failure
来源:互联网 发布:淘宝店铺布局和理性 编辑:程序博客网 时间:2024/05/21 13:55
1:问题描述:
使用Connector/J连接MySQL数据库,程序运行较长时间后就会报以下错误:
Communications link failure,The last packet successfullyreceived from the server was *** millisecond ago.The last packet successfullysent to the server was *** millis econd ago。
如图:
2:解决方案:主要有两个:
2.1:修改my.cnf:
[mysqld]
wait_timeout=31536000
interactive_timeout=31536000
将过期时间修改为1年。
2.2:在连接URL上添加参数:&autoReconnect=true&failOverReadOnly=false
3:问题分析:
MySQL服务器默认的“wait_timeout”是28800秒即8小时,意味着如果一个连接的空闲时间超过8个小时,MySQL将自动断开该连接,而连接池却认为该连接还是有效的(因为并未校验连接的有效性),当应用申请使用该连接时,就会导致上面的报错。
0 0
- mysql: Communications link failure
- mysql Communications link failure
- mysql: Communications link failure解决
- mysql: Communications link failure解决
- communications link failure MySQL ibatis
- 解决mysql:Communications link failure
- mysql异常:Communications link failure
- MySQL Communications link failure问题
- mysql 中Communications link failure的解决方法
- mysql 中Communications link failure的解决方法
- 数据库连接失败Communications link failure mysql
- com.mysql.jdbc.CommunicationsException: Communications link failure
- Mysql Communications link failure 问题的解决
- MySQL连接超时Communications link failure
- MySQL连接超时Communications link failure
- Mysql: Cannot create PoolableConnectionFactory (Communications link failure
- MySql的Communications link failure解决办法
- mysql - Communications link failure的解决办法
- Win7 安装Sql Server200…
- 《将博客搬至CSDN》
- PHP Switch 语句
- C#之重载与覆盖
- HashTable原理解析
- mysql: Communications link failure
- 验证码功能实现
- 奶茶妹你弱爆了 史上最漂亮萌妹:七科满分保送剑桥
- 声明和初始化变量
- [OJ]找零钱
- PHP 数组
- 详解Oracle多种表连接方式
- apue读书笔记【二】:处理可变参数(2) vsnprintf
- nginx 负载均衡之 ngx_http_upstream_hash_module