解决com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link
一、可能导致这样的原因
1.配置文件中的url不正确(排除)
<url>jdbc:mysql://localhost:3306/env</url>
2.mysql的连接等待时间默认为8小时,28800秒(不太可能因为这个,毕竟程序启动还没多久)
如果要将mysql的全局变量wait_timeout的值修改为最大。查看mysql5的手册,发现windows和linux下wait_timeout的最大值分别是24天和365天。
(1).在文件my.ini的最后增加一行:wait_timeout=1814400。(该文件,windows下在mysql的安装目录下,linux下位置为/etc/my.ini)
(2).重启mysql。
3.修改mysql驱动版本,因为之前一直用的是5.1.49,就想到了这个,没想到真的成功了
解决com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link相关推荐
- com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure 数据库报错
-- 查询mysql 数据库链接空闲时间持有最大空闲时间,单位为秒 SHOW VARIABLES WHERE VAriable_name = 'interactive_timeout'; -- 会出现 ...
- Mysql学习总结(62)——MySQL连接com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link问题
数据库出现如下连接问题 com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure The ...
- Cause com.mysql.jdbc.exceptions.jdbc4.CommunicationsException:Communications link failure 问题解决 报错
Cause: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure 问题解决 Cau ...
- com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
昨天数据库做了一些改动,早上再打开的项目的时候就出现了这样的问题 com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communicat ...
- 问题记录——com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure...
最近在搞一个Spring boot + Mybatis + Mysql的项目,用Mybatis访问数据库时,报了如下的错误,先在网上搜索了,试了各种办法都不行, 奇葩的是,连接另外1个数据库又没问题. ...
- mysql连接com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link
jdbc驱动:mysql-connector-java-5.1.39-bin.jar 这个有问题, 换成:mysql-connector-java-5.1.34.jar 就可以了 转载于:https: ...
- 严重:init datasource errorcom.mysql.jdbc.exceptions.jdb4.CommunicationsException:Communications link失败
解决办法: 1.检查是否导入druid-1.0.9.jar包 2.检查druid.Properties配置文件中的中的各参数url.username.password是否跟自己的匹配 3.检查自己的m ...
- mysql第二天无法连接_MySQL第二天早上第一次连接超时报错,解决方法com.mysql.jdbc.exceptions.jdbc4.CommunicationsException:...
http://zeusami.iteye.com/blog/1112827 MySQL第二天早上第一次连接超时报错,解决方法com.mysql.jdbc.exceptions.jdbc4.Commun ...
- com.mysql.jdbc.exceptions.jdbc4.CommunicationsException
新建的网站出现如下错误: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: The last packet successfully r ...
最新文章
- 虚拟化--图解交互式方式安装ESXi_5.0的过程
- 题目1172:哈夫曼树
- 成功解决AttributeError: type object 'scipy.interpolate.interpnd.array' has no attribute '__reduce_cython
- 视觉研究的前世今生(中)王天珍(武汉理工大学)
- Spark(一)-- Standalone HA的部署
- 无人驾驶(如何自己构建hdmap)
- 关于Clipboard剪切板获取值为NULL问题解决方法
- 机器学习/深度学习测试题(一) —— 单层感知器的激活函数
- linux代码折叠,VIM 代码折叠 :set foldmethod=marker
- 一本书学会可视化设计 pdf_【推荐给设计师看的11本书】电子版PDF
- Visio 2013 Professional专业版密钥
- matlab xlswrite函数,matlab打开excel (xlsread、xlswrite)实用方法...
- 我想成为一个记计算机程序员英语作文,关于程序员的英语作文
- inter至强服务器处理器型号,至强cpu性能排行2021
- 设计方案,写了才知道有多香
- Vue 中使用Pug
- 小论电阻1(电阻的参数)
- 保险资管需求多元化 壹资管平台赋能行业智能化转型
- 黄聪:Destoon供求栏目下旺旺无法正常显示,点击提醒“会员名不存在”
- python圆周率后100位_Python实现计算圆周率π的值到任意位的方法示例