Mysql连接问题:com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException
com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Data source rejected establishment of connection, message from server: "Too many connections"
原因:因为你的MySQL安装目录下的my.ini中设定的并发连接数太少或者系统繁忙导致连接数被占满
解决方式:
打开MYSQL安装目录打开MY.INI找到max_connections(在大约第93行)默认是100 一般设置到500~1000比较合适,重启mysql,这样1040错误就解决啦。
max_connections=1000
具体步骤:
1.Mysql数据库的默认连接数是100。
2.默认值100对于一般的程序都不是很够用,如果只是在自己的电脑上调试程序,有可能发现不了这个问题,因为调试程序时会经常重起Tomcat。
3.如果使用Hibernate框架来进行数据库操作,这个问题尤其明显。
4.解决方法:加大Mysql连接数。在Mysql安装文件中,找到my.ini文件,在里面找到
max-connections=100,将这个100变大一点,直接来个1000算了。
PS:具体需要修改的数值需要根据自己项目的实际情况而定...
Mysql连接问题:com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException相关推荐
- com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException异常解决方法
在使用MySQL驱动进行JDBC时候出现了以下异常 Exception in thread "main" com.mysql.jdbc.exceptions.jdbc4.MySQL ...
- com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Public Key Retrieval is not?
问题 :连接MySQL数据库时抛出异常信息: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Public ...
- Maven项目中:com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could not create conn
报错信息 详细信息 ERROR [Druid-ConnectionPool-Create-2074541388] - create connection error, url:jdbc:mysql:/ ...
- com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could not create connection to
困扰了我两天的异常 com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could not create con ...
- 【DEBUG】com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Client does not support
项目场景: 使用 Spring SpringMVC Mybatis 进行整合SSM的过程中,声明一个声明式事务的查询服务,发现无法使用. @Service public class EmpServic ...
- 启动项目出现com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException异常解决方法
启动SpringBoot项目失败mysql连接错误 2020-03-21 20:16:25.193 INFO 8204 --- [ main] com.cnadmart.ApiA ...
- MySQL报错:com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException
一.原因分析 原因1:环境配置方面 MySQL版本与驱动版本不匹配.如:MySQL8.0 (8.0版本)搭配 mysql-connector-java-5.1.37.jar(5.0版本) 原因2:代码 ...
- 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 ...
最新文章
- 2021年机器学习的下一步是什么?
- 强化学习AI:它菜了,我慌了
- MySQL导入sql 文件的5大步骤
- 在express.js上启用HTTPS
- setbuf()关闭缓冲
- Java国际化的简单实现方法
- Android中使用SeekBar拖动条实现改变图片透明度
- 10 windows 启动虚拟机报错_Windows 系统如何安装 Docker
- xfce开始菜单增加一个新的图标
- 泰坦尼克号幸存率研究
- 用python计算矩形面积结果四舍五入保留两位小数_你还在计算器开平方?太low了吧,学霸考场都用这种方法开平方...
- thinkphp5连接数据库mysql_ThinkPHP学习(三)配置PHP5支持MySQL,连接MySQL数据库
- 聚合丁苯橡胶(SSBR)行业调研报告 - 市场现状分析与发展前景预测
- [译] Object.assign 和 Object Spread 之争, 用谁?
- Python 数据结构与算法 —— list与deque(双端队列)
- 5. PHP APC APCu 安装使用
- 如何使用Java代码获取Android移动终端Mac地址
- Atitit.antlr实现词法分析
- Delphi视频教程
- kettle下载和使用
热门文章
- Spring data redis应用示例
- lnmp.org + phpstorm + xdebug
- 如何通过网络,辨别数字世界的真假
- 在Linux中安装SEP Client
- (素材源码)猫猫学IOS(十六)UI之XIB自定义Cell实现团购UI
- ubuntu下移植QT基本流程
- Talk O/RM (DAL) too ...
- 鼠标滑过某一个图标时,提示讯息
- 老年机按键串号_老人机怎么解除*号键解锁
- struts2 ajax html,Struts2+Jquery+Ajax+Json