Three commonly used methods to modify the maximum number of connections in mysql

https://blog.csdn.net/lovemysea/article/details/73834917

Method 1: Enter the MYSQL installation directory and open the MYSQL configuration file my.ini or my.cnf to find max_connections=100 and change it to max_connections=1000. Restart MYSQL in the service.


Method 2: The maximum number of MySQL connections is 100 by default. Client login: mysql -uusername -ppassword


Set the new maximum number of connections to 200: mysql> set GLOBAL max_connections=200


Display the currently running Query: mysql> show processlist


Display the current status: mysql> show status


Exit the client: mysql> exit


to view the current maximum number of connections : mysqladmin -uusername -ppassword variables


Method 3: Take the manually compiled version of mysql 5.0.33 under centos 4.4 as an example:


vi /usr/local/mysql/bin/mysqld_safe


Find safe_mysqld and edit it, find the two lines where mysqld starts, Add the parameter after:


-O max_connections=1500
 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325245541&siteId=291194637