How to set the maximum number of mysql connections: first open the mysql console; then enter the statement [set GLOBAL max_connections=1000;] to directly set the maximum number of connections.
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? The following article will take you through two methods of setting the maximum number of mysql connections. I hope it will be helpful to you. [Video tutorial recommendation: MySQL tutorial]
How to set the maximum number of mysql connections:
Method 1: Command line modification
We only need to open the mysql console and enter the "set GLOBAL max_connections=1000;" statement to directly set the maximum number of connections, as shown in the following figure:
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 return to the original value.
Method 2: Modify the maximum number of connections through the mysql configuration file
1. Open the mysql installation directory on the computer and find the my.ini file, as shown below:
#2. Open the my.ini file with Notepad, find and modify the value of "max_connections", the default maximum number of connections 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]--> [Service]-->[MySQL]
Click mysql and right-click to start or shut down, as shown in the figure below:
In this way, the maximum number of mysql connections is set to 1000, and it is a permanent setting.
The above is the entire content of this article, I hope it will be helpful to everyone's study. For more exciting content, you can pay attention to the relevant tutorial columns of the PHP Chinese website! ! !
The above is the detailed content of How to set the maximum number of connections in mysql. For more information, please follow other related articles on the PHP Chinese website!