'User has exceeded the max_user_connections resource' Error in MySQL Due to Limited Connection Pool
Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.
Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Symptoms
The following error occurs in the logs:
1
2
3
4
Caused by: com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: User 'jirauser' has exceeded the 'max_user_connections' resource (current value: 10)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1026)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:956)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3515)
Cause
This problem is caused by a setting in MySQL limiting the number of connections.
Resolution
Limit the size of the connection pool on your application server so it will not exceed max_user_connections
. In Tomcat, this is done by setting the maxActive parameter to the <Resource>
element:
1
2
3
4
5
6
7
<Context ...>
<Resource name="jdbc/jiradb" auth="Container"
type="javax.sql.DataSource" username="jirauser" password="dbpassword"
driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost:3306/javatest?autoReconnect=true"
maxActive="20" />
</Context>
Was this helpful?