Home >Database >Mysql Tutorial >A brief analysis of two methods for setting the maximum number of connections in mysql
How to set the maximum number of connections in mysql? The following article will introduce to you two methods for setting the maximum number of connections in MySQL. I hope it will be helpful to you.
Usually, the default maximum number of connections for mysql is 100, and the maximum number can reach 16384; if we want to modify the maximum number of connections for mysql, how to set it? Take a look below.
We only need to open the mysql console and enter the "set GLOBAL max_connections=1000;" statement to directly set the maximum connection Number, as shown in the figure below:
Note: This method does not cure the problem. It can only temporarily modify the maximum number of connections. If you restart mysql, the maximum number of connections will change again. Return to the originally set value.
1. Open the mysql installation directory on the computer and find the my.ini file, as shown below Shown:
2. Open the my.ini file with Notepad, find and modify the value of "max_connections", the default maximum number of connections It is 100, as shown in the figure below:
Set "max_connections=1000", so that the maximum number of mysql connections can be set to 1000.
3. After setting the maximum number of connections, you need to restart the mysql service
Go to [Computer]-->[Management]-->[Services and Applications] Program]-->[Service]-->[MySQL]
Click mysql and right-click to start or shut down, as shown in the following figure:
This sets the maximum number of mysql connections to 1000, and it is a permanent setting.
[Related recommendations: mysql video tutorial]
The above is the detailed content of A brief analysis of two methods for setting the maximum number of connections in mysql. For more information, please follow other related articles on the PHP Chinese website!