【问题解决】Data source rejected establishment of connection, message from server: “Too many connections“

问题描述:详细报错信息如下

java.sql.SQLNonTransientConnectionException: Data source rejected establishment of connection,  message from server: "Too many connections"
2020/8/15 下午8:18:19 	at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:110)
com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122)
2020/8/15 下午8:18:19 	at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:836)
2020/8/15 下午8:18:19 	at com.mysql.cj.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:456)
....
2020/8/15 下午8:18:19 	at com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:246)
2020/8/15 下午8:18:19 	at com.zaxxer.hikari.pool.PoolBase.newConnection(PoolBase.java:353)
2020/8/15 下午8:18:19 	at com.zaxxer.hikari.pool.PoolBase.newPoolEntry(PoolBase.java:201)
2020/8/15 下午8:18:19 	at com.zaxxer.hikari.pool.HikariPool.createPoolEntry(HikariPool.java:473)
2020/8/15 下午8:18:19 	at com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:562)
2020/8/15 下午8:18:19 	at com.zaxxer.hikari.pool.HikariPool.<init>(HikariPool.java:115)
2020/8/15 下午8:18:19 	at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)

问题原因:mysql客户端连接数量超过了默认的最大连接数(151)。

问题解决:将mysql的最大连接数调大,参考《mysql5.7最大连接数修改》

你可能感兴趣的:(错误记录并解决)