Hi this document deals with mysql error “Mysql too many connections”, This error are occurs when there is a lot of database connection occurs when cannot be handled by mysql server. There are few things which we need to consider on this, the following are the line items to be considered.

1. System RAM
2. Thread per each request
3. Response Time.

Inorder to solve the above error check the current max connection limit

To see what the current connection limit is, you can run the following from the MySQL command line

mysql> show variables like “max_connections”
-> ;
| Variable_name | Value |
| max_connections | 151 |
1 row in set (0.00 sec)

Increasing the Connection Limit

To increase the global number of connections temporarily, you can run the following from the command line:

set global max_connections = 200

mysql> show variables like “max_connections”
-> ;
| Variable_name | Value |
| max_connections | 200 |
1 row in set (0.40 sec)

If you want to make the increase permanent, you will need to edit the my.cnf configuration file

max_connections = 200

The next time you restart MySQL, the new setting will take effect and will remain in place unless or until this is changed again.

Use grafana to monitor mysql databases

© 2018, Techrunnr. All rights reserved.

Questions Answered
Articles Written
Overall Points
Categories: database

Prabhin Prabharkaran

He is Technical professional. He is a person who loves to share tricks and tips on the Internet. He Posts what he does!!


Leave a Reply

Please wait...

Subscribe to our newsletter

Want to be notified when our article is published? Enter your email address and name below to be the first to know.