MySQLNonTransientConnectionException: Data source rejected establishment of connection, message from server: "Too many connections"
com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Data source rejected establishment of connection, message from server: "Too many connections"
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.8.0_112]
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:) ~[?:1.8.0_112]
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:) ~[?:1.8.0_112]
at java.lang.reflect.Constructor.newInstance(Constructor.java:) ~[?:1.8.0_112]
at com.mysql.jdbc.Util.handleNewInstance(Util.java:) ~[mysql-connector-java-5.1..jar:5.1.]
at com.mysql.jdbc.Util.getInstance(Util.java:) ~[mysql-connector-java-5.1..jar:5.1.]
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:) ~[mysql-connector-java-5.1..jar:5.1.]
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:) ~[mysql-connector-java-5.1..jar:5.1.]
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:) ~[mysql-connector-java-5.1..jar:5.1.]
at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:) ~[mysql-connector-java-5.1..jar:5.1.]
at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:) ~[mysql-connector-java-5.1..jar:5.1.]
at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:) ~[mysql-connector-java-5.1..jar:5.1.]
at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:) ~[mysql-connector-java-5.1..jar:5.1.]
at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:) ~[mysql-connector-java-5.1..jar:5.1.]
at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:) ~[mysql-connector-java-5.1..jar:5.1.]
at sun.reflect.GeneratedConstructorAccessor9.newInstance(Unknown Source) ~[?:?]
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:) ~[?:1.8.0_112]
at java.lang.reflect.Constructor.newInstance(Constructor.java:) ~[?:1.8.0_112]
at com.mysql.jdbc.Util.handleNewInstance(Util.java:) ~[mysql-connector-java-5.1..jar:5.1.]
at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:) ~[mysql-connector-java-5.1..jar:5.1.]
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:) ~[mysql-connector-java-5.1..jar:5.1.]
at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:) ~[druid-1.1..jar:1.1.]
at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:) ~[druid-1.1..jar:1.1.]
at com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:) [druid-1.1..jar:1.1.]
这个我在网上查了一些相关的资料,上面有的说是MySQL上面的max_connections没有开启,
show variables like 'max_connections'; set global max_connections=
使用上面的可以进行临时开启,想要一直开启就需要去MySQL下面的my.ini文件里修改
修改完之后运行发现还是不行,我使用的是DbUtils工具类,在里面传递连接的时候我使用的是connection,没有使用数据源只执行了400多条语句就挂了
后来使用datasource就没有出现问题,之后在网上查了一些资料,上面说的是使用数据源dbutils会默认进行资源回收,但是使用connection则不会,需要你在自行回收
MySQLNonTransientConnectionException: Data source rejected establishment of connection, message from server: "Too many connections"的更多相关文章
- com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Data source rejected establishment of connection, message from server: "Too many connections"
报错: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Data source rejected estab ...
- Data source rejected establishment of connection, message from server: "Too many connections"解决办法
异常名称 //数据源拒绝从服务器建立连接.消息:"连接太多" com.MySQL.jdbc.exceptions.jdbc4.MySQLNonTransientConnection ...
- Data source rejected establishment of connection, message from server: "Too many connections"
详细错误信息: Caused by: com.MySQL.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Data source ...
- mysql: Data source rejected establishment of connection, message from server: "Too many connections"
http://www.oschina.net/question/558677_66703 com.mysql.jdbc.exceptions.MySQLNonTransientConnectionEx ...
- 由于没有发现潜在的递归导致MySQL链接数溢出:MySQLNonTransientConnectionException: Data source rejected establishment of connection, message from server: "Too many connec
DAOProxy的代码:下面代码中红色高亮的就是出问题的地方,DAOFactory中会构造一个PersonDAOProxy,调用listPersons或者addPerson显然会导致递归,从而导致My ...
- Data source rejected establishment of connection, message from server: "Too many connections"
错误叙述性说明: 測试一段时间没有不论什么问题.今天突然用户无法登录,报错如Data source rejected establishment of connection, message fro ...
- 前段时间,接手一个项目使用的是原始的jdbc作为数据库的访问,发布到服务器上在运行了一段时间之后总是会出现无法访问的情况,登录到服务器,查看tomcat日志发现总是报如下的错误。 Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Data source rejected est
前段时间,接手一个项目使用的是原始的jdbc作为数据库的访问,发布到服务器上在运行了一段时间之后总是会出现无法访问的情况,登录到服务器,查看tomcat日志发现总是报如下的错误. Caused by: ...
- Mysql:报错message from server: "Too many connections"(连接太多)
报错信息 Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Data source re ...
- How to: Secure Connection Strings When Using Data Source Controls
https://docs.microsoft.com/en-us/previous-versions/dotnet/netframework-3.0/dx0f3cf2(v=vs.85) When wo ...
随机推荐
- BZOJ 3932 - 主席树
传送门 题目分析 在只打会主席树模板的情况下做了这道题,也算是深有体会. 首先任务可以差分:一个任务是(s, e, p), 则在s处+1, 在e+1处-1,符合前缀.但是我们要查询指定时间的前k任务之 ...
- WPF Opacity 最小值多少会被击穿
粗略测试 这样也行.再小不懂咯(跟Double精度有关???) <WrapPanel.Background> <SolidColorBrush x:Name="opacit ...
- 《Head First 设计模式》学习笔记——命令模式
在软件系统,"行为请求者"与"行为实施者"通常存在一个"紧耦合".但在某些场合,比方要对行为进行"记录.撤销/重做.事务" ...
- Notice: Undefined index: user in D:\phpStudy\WWW\js\ls\lsmc\php\add.php on line 9
原文:Notice: Undefined index: user in D:\phpStudy\WWW\js\ls\lsmc\php\add.php on line 9 (初用数据库(mysql)做用 ...
- 数据中台解析Hive SQL过程
一.数据中台解析SQL的目的: 数据中台需要对外提供数据特征查询的能力,因此中台查找并解析各个平台的sql,找出哪些表中的字段经常被使用,以便沉淀为特征,而我们要做的是找出sql中的数据表及其字段.以 ...
- 阐述php(五岁以下儿童)
注意事项和使用功能
1.函数声明 <?php /** * function 函数名(參数1, 參数2.... ){ * 函数体; * 返回值; * } */ $sum = sum(3, 4); echo $sum; ...
- C#中的String.Format介绍
关键字:C# string.format作者:txw1958原文:http://www.cnblogs.com/txw1958/archive/2012/11/15/csharp-string_for ...
- 基于高德地图的描点操作,监听地图缩放,展示合理数量的marker
原文:基于高德地图的描点操作,监听地图缩放,展示合理数量的marker 版权声明:本文为博主原创文章,未经博主允许不得转载. https://blog.csdn.net/lx583274568/art ...
- 移动浏览器Chrome 32 for Android移除300ms点击推迟
在手机浏览器的一篇文章翻译300ms延迟实用文章,原文地址 http://updates.html5rocks.com/2013/12/300ms-tap-delay-gone-away 去掉移动设 ...
- WPF 将Bitmapsource转换到Emgu.cv.image
原文:WPF 将Bitmapsource转换到Emgu.cv.image Transform WPF BitmapSource to Emgu.CV.Image******* /// <summ ...