Warning: mysql_connect() [function.mysql-connect]: Too many connections


Stop worrying about your server Let us manage it ūüôā

Server Management for just¬†$59/mo¬†with¬†Unlimited tickets, Unlimited admin hours, Security audits, 24×7 monitoring and lot more¬†

cPanel Server Management  $59/mo Click here

Warning: If you are not an expert in command line please dont do these steps

This happens when you website to to create too many MySQL connections that allowed

Either you can tweak the website code to close the connections quickly or increase the MySQL connection using below steps.


First check the current connection limit

show variables like "max_connections";
| Variable_name | Value |
| max_connections | 150 |

So no the connection limit is 150

We can increase it by adding the below code in my.cnf file

vi /etc/my.cnf
max_connections = 500

Now restart the MySQL service

Monthly server support with Unlimited tickets, 24×7 monitoring, Security Audit and lot more for just $59

Server Management at just $59

Leave a Reply

Your email address will not be published. Required fields are marked *