In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article focuses on "how to modify the maximum number of mysql connections", interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn how to modify the maximum number of connections in mysql.
Modify the method: 1, execute the "set GLOBAL max_connections= connection value;" command. 2. Open the mysql configuration file "my.cnf", add the "max_connections= connection value" statement to the file, save the file and restart the service.
The operating environment of this tutorial: windows7 system, mysql8 version, Dell G3 computer.
The maximum number of connections can be modified through mysql. There are two common ways to modify the maximum number of connections in mysql database. Today, we analyze the characteristics and differences between the two methods, so that we can better maintain mysql. Let's take a look at how mysql modifies the maximum number of connections. I hope the article can help you.
problem
When using MySQL databases, we often encounter such a problem, which is the "Can not connect to MySQL server. Too many connections"-mysql 1040 error, 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.
There are two common ways to modify the maximum number of connections.
Solution 1: through the command
You can set the maximum number of connections to 100 through the set GLOBAL max_connections=100; command, which takes effect immediately and does not require a restart of the mysql service.
It should be noted that the operation can only be done through the mysql account with root permission, otherwise an error of "1227-Access denied; you need (at least one of) the SUPER privilege (s) for this operation" will be reported.
At the same time, set the minimum max_connections to 1.
Solution 2: modify my.cnf
Open the mysql configuration file vim / etc/my.cnf, add the max_connections=100 line (if any, directly modify the value), and then restart the service: / etc/init.d/mysqld restart, which takes effect.
Difference:
1. By modifying the configuration file, the service needs to be restarted, and the command modification takes effect immediately.
two。 By modifying the configuration file, it is more stable and reliable. Because if there is max_connections=100 in the configuration file, and then modify it with the command, once the mysql service is restarted, the number of connections specified in the configuration file will prevail again.
At this point, I believe you have a deeper understanding of "how to modify the maximum number of mysql connections". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.