MySQL Error: Too many connections

CentOS Web Panel is deployed in Contact us to find out our latest offers!

Error on the website or in cwp:

ERROR 1040 (HY000): Too many connections
PHP Warning: mysqli_connect(): (HY000/1040): Too many connections

The default value for the maximum permitted number of simultaneous client connections is 150.

If you have sites with high peaks or high traffic then you can increase the limit.

Check the current connection limits

mysql -e "show variables like '%connection%';"

To increase the limits you can edit this file /etc/my.cnf.d/server.cnf
Add max_connections = 500 under [mysqld] line.

For the new values to get accepted you need to restart the mysql server.

service mysql restart

Now you can recheck again if the limits got increased.

CentOS Web Panel is deployed in Contact us to find out our latest offers!

Comments are closed.