In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
1. View the maximum number of connections
Mysql > show variables like "% max_connections%"; ±- ±- + | Variable_name | Value | ±- ±- + | max_connections | 141 | ±- ±- + 1 row in set (0.00 sec)
2. Modify the maximum number of connections
The default value for the maximum number of connections in MySQL is 100, which is far from enough for database applications with a large number of concurrent connections. When the connection request is greater than the default number of connections, there will be an error that cannot connect to the database, so we need to make it larger appropriately. A problem often encountered when using a MySQL database is a "Can not connect to MySQL server. Too many connections"-mysql 1040 error, which is because the number of connections that have not been released to MySQL has reached the MySQL limit. In general, the maximum number of connections for MySQL is 100 by default, and the maximum can reach 16384.
Two common ways to modify the maximum number of connections are as follows:
First: the command line modifies the maximum number of connections (max_connections) to set the maximum number of connections to 1000.
Mysql > set global max_connections = 1000
There is a problem with this approach, that is, the maximum number of connections set is only valid for the current MySQL service process, and once MySQL is restarted, it will return to its initial state. Because the initialization work of MySQL after startup reads data from its configuration file, and no changes are made to its configuration file in this way.
Second: modify the maximum number of MySQL connections (max_connections) by modifying the configuration file.
Enter the MySQL installation directory, open the MySQL configuration file my.ini or my.cnf to find max_connections=100, modify it to max_connections=1000, and restart the MySQL service.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.