How to increase maximum connections limit in mysql without a restart

Default maximum concurrent connections a mysql database server can handle is set as 100. If you require your mysql database server to serve higher number of concurrent connects than 100, you can set this on the fly as bellow without restarting the mysqld service. Make sure you have enough hardware resources (Generally RAM) to accommodate more connections.

To check current maximum concurrent connections,

mysql> show variables like “max_connections”;
+—————--+——-+
| Variable_name | Value |
+—————--+——-+
| max_connections | 100 |
+—————--+——-+
1 row in set (0.01 sec)

“max_connections” is a GLOBAL variable. Use following command to set maximum connections to 200.

mysql> set global max_connections = 200;
Query OK, 0 rows affected (0.00 sec)

Note:
It is advised that you edit the my.cnf to increase max_connections to avoid any issues as mysql service restart will reset the value to default.

One thought on “How to increase maximum connections limit in mysql without a restart

Leave a Reply

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