This is an short tutorial how to fix (42000/1203): User already has more than ‘max_user_connections’ active connections in mysql database server.
You will see an error failed to connect to database.
This errors thrown from client machine connecting to database server.
In MySQL, There is a limit on the maximum number of simultaneous connections to database server.
If maximum connecttions from the same user to database is more than defined database
The solution is to increase
max_user_connections at database server.
MySQL has a system variable
max_user_connections that can be configured at either startup or runtime.
First check how many maximum user connections are allowed using below command
show global variables like '%connections%'
It outputs following things
max_connections 4030 max_user_connections 0 reserved_super_connections 20
As per above command
max_user_connections is zero that means there is no limit on number of connections allowed.
if max_user_connections is non zero value, increase it to some value.
How can you increase max_user_connections in mysql?
There are multiple ways we can configure at startup or runtime
- startup to change maximum connections
Go to MySQL\Data\my.ini and update with below values
max_user_connections = zero or give total connection you want
the below are possible values zero number means no limit on number of connections positive number is maximum connections
- Runtime to change maximum connections IN the command line, You can set global system variable value to zero or positive number
SET GLOBAL max_user_connections = 0 or number;
Once you set with either startup or command line, You need to restart server to take effect.
The above changes made from client machine or database server.
You learned how to solve maximum connections