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". I assume that you have enough hardware resources (Mainly RAM )to handle more connections, here with this article I will share a TIP to increase max_connections in mysql.
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)
No comments:
Post a Comment