mysql connection error

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;

Check Out: How To Check Users In Mysql Database Server In Linux

Login to your MySQL server and run this command to check max_connection

show variables like “max_connections”;

Solve MySQL Too Many

As you can see the default connection is 151 So you have to increase its size.

Check Out: Install MySQL 5.6 Database Server Using Repository

To change the value of max_connection can be done by the set command

SET GLOBAL max_connections =512;

mysql set max connections

Now verify

too many connections mysql

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.

Check Out: Different Ways of Finding Table Size In Mysql Server

Now restart the MySQL service to take an effect.

That’s it. mysql set max connections


Please enter your comment!
Please enter your name here