Solve MySQL too many Connections Error
Solve MySQL too many, It can be as when a client tries to connect MySQL server then request it’s rejected or not connected and receive an error “too many connections“ to the server has been reached. we can also set max connections in MySQL.
So you will have to increase max_connections request in my.cnf file in order to resolve this issue.
We can also set the failed connection in MySQL error logs using SET GLOBAL log_warnings = 2;
Login to your MySQL server and run this command to check max_connection
show variables like “max_connections”;
As you can see the default connection is 151 So you have to increase its size.
To change the value of max_connection can be done by the set command
SET GLOBAL max_connections =512;
This’s a temporary solution as when MySQL service would be restart, this would again set to default value 151. To make it permanent, change it in /etc/my.cnf file.
Now restart the MySQL service to take an effect.
That’s it. mysql set max connections