Communications link failure mysql自动停止 连接拒绝 mysqld dead but sub。。。
服务器环境中
JAVA 连接数据库 Communications link failure, Contection refused
网上很多这种情况,解决基本上是将127.0.0.1换成localhost
但是我这个比较傻b,原因也很无奈。值得纪念,以下是我解决的过程,过程还是值得学习的。
1、症状:java 连接数据库 访问拒绝 连接拒绝。
原因:基本上是围绕着 IP,PORT,DB,USERNAME,PASSWORD这几个参数,只能是这里出了问题。
过程:将127.0.0.1换成localhost,还是不行,修改timeout时间也不行(如果修改超时时间就可以了,你应该查看是什么原因造成连接时间过长)
原因:原来是数据库停止了,是IP参数造成的。
为什么mysql停止了呢?
2、症状:java连接数据库,出现 mysqld killed。。(比较隐蔽,一般看不到)查看mysql状态,显示mysql dead。。
原因:一般正常来说,mysqld是被mysqld_safe管理的,mysqld_safe相当于一个守护进程,一般mysql出现错误,停止后,mysqld_safe会自动重启mysql
然而,mysqld 却 dead 了,这显然不正常,说明mysqld_safe没有重启mysql,或重启失败了。
过程:查看mysqld_safe日志,确实显示重启失败。
原因:内存不够了。。。。。。。
原来,mysql启动时会创建一个默认128M的缓冲池,当时服务器上跑的程序太多了,连128M都分不出来了。
解决:升级服务器,关闭不需要的程序,调低mysql buffer pool 大小
Communications link failure mysql自动停止 连接拒绝 mysqld dead but sub。。。的更多相关文章
- 解决MySQL连接超时Communications link failure due to underlying exception
最近在用一个MySQL的Java连接池的过程中,连接一晚上不释放,第二天就会造成超时的错误,查了一下原因,原来是因为MySQL默认的空闲等待时间是8个小时,一旦空闲超过8个小时,就会抛出异常.异常文本 ...
- jdbc 连接mysql Communications link failure的解决办法
使用Connector/J连接MySQL数据库,程序运行较长时间后就会报以下错误: Communications link failure,The last packet successfully r ...
- mysql连接com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
现象:客户端连接服务器端mysql是没问题的,所有都木有问题,应用程序配置也没问题,但是连接就抛异常: com.mysql.jdbc.exceptions.jdbc4.CommunicationsEx ...
- Java连接MySQL报错:CommunicationsException: Communications link failure
现象: 报错:Exception in thread "main" com.mysql.cj.jdbc.exceptions.CommunicationsException: Co ...
- com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure 解决办法
09:00:30.307 [http-8080-6] ERROR org.hibernate.transaction.JDBCTransaction -JDBC begin failed com.my ...
- Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
很长的报错,截取 ERROR c.a.d.p.DruidDataSource - discard connection com.mysql.jdbc.exceptions.jdbc4.Comm ...
- mysql 5.1超过默认8小时空闲时间解决办法(错误:com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure)
报错: MySQL第二天早上第一次连接超时报错, com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications lin ...
- Mysql Communications link failure 问题的解决
问题现象 com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure The last p ...
- Cause: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure 解决
感谢大佬:https://blog.csdn.net/a704397849/article/details/93797529 springboot + mybatis多数据库 + druid连接池配置 ...
随机推荐
- 二分查找法(java版)
二分查找法也称为折半查找法,在有序的序列中使用二分法可以提高程序的执行效率. 典型的二分查找法代码 public int binarySearch1(int[] arr,int target){ in ...
- iconv 转换文件的编码格式
1.命令功能 icnov用于转换文件的编码格式 linux默认中没有icnov文件,需要自己安装http://www.gnu.org/software/libiconv/. (1)下载libiconv ...
- P.W.N. CTF - Web - Login Sec
题目 链接:https://ctftime.org/task/6934 题解 Login 1 题目给出了源码 var http = require('http'); const crypto = re ...
- 将postgresql中的数据实时同步到kafka中
参考地址:https://blog.csdn.net/weixin_33985507/article/details/92460419 参考地址:https://mp.weixin.qq.com/s/ ...
- 学习旧岛小程序 (1) flex 布局
css : view 相当于 div 块级元素 display 默认设置 block display:inline 设置后 设置宽度高度是无效的 要设置宽度高度 又要设置为行内元素 我们设置: (1) ...
- centos启动提示unexpected inconsistency RUN fsck MANUALLY
今天一台虚拟机背后的物理机故障了,主机迁移后变成了 read only filesystem.上面部署了很多长连接服务,没有关掉就直接reboot,报错: unexpected inconsisten ...
- Vue项目安装CubeUI
CubeUi GitHub地址:https://github.com/didi/cube-ui install vue add cube-ui 项目中 会多出cube ui 的配置文件来
- (arm板子tensorflow安装)armv7板子pip安装的wheel
树莓派之类的armv7板子在,安装 numpy,scipy时经常失败,因为安装过程是下载源码包到本地编译,然后再安装的,编译过程中往往就会失败. https://www.piwheels.org/si ...
- python 全栈开发,Day54(关于DOM操作的相关案例,JS中的面向对象,定时器,BOM,client、offset、scroll系列)
04-jQuery的属性操作 jquery的属性操作模块分为四个部分:html属性操作,dom属性操作,类样式操作和值操作 html属性操作:是对html文档中的属性进行读取,设置和移除操作.比如at ...
- Angular:实现组件间双向数据绑定
学过Angular的同学都知道,输入框通过[(ngModel)]实现双向数据绑定,那么父子组件间能不能实现双向数据绑定呢?答案是肯定的. Angular中,我们常常需要通过方括号[]和圆括号()实现组 ...