How to increase max connections in mysql, so that it can handle huge connections from applications.
By default in mysql database server max_connections is set to 100. This value indicates how many maximum concurrent connections mysql server can handle. If mysql reaches to it maximum (max) limit then you can see errors like "too many connections".
As we know my.cnf is default configuration file for mysqld service and by default it is located in /etc directory unless and until you have changed it.
To find out how many max_connections are allowed currently on your mysql server use following command from mysql prompt.
To do so use following command.
By default in mysql database server max_connections is set to 100. This value indicates how many maximum concurrent connections mysql server can handle. If mysql reaches to it maximum (max) limit then you can see errors like "too many connections".
As we know my.cnf is default configuration file for mysqld service and by default it is located in /etc directory unless and until you have changed it.
To find out how many max_connections are allowed currently on your mysql server use following command from mysql prompt.
-
mysql> select @@max_connections;
+-------------------+
| @@max_connections |
+-------------------+
| 100 |
+-------------------+
1 row in set (0.00 sec)
To do so use following command.
-
mysql> set global max_connections = 200;
Query OK, 0 rows affected (0.00 sec)
-
mysql> select @@max_connections;
+-------------------+
| @@max_connections |
+-------------------+
| 200 |
+-------------------+
1 row in set (0.00 sec)