) MYSQL: Too connector connections

Source: Internet
Author: User
$ Mysql-uroot

Error 1040 (00000): Too connector connections

The above error is probably encountered by many people. aurimas mikalauskas has mentioned a solution in the MySQL performance blog (with caution in the production environment ):

$ GDB-p $ (cat data/mysql_sandbox5087.pid )\

-Ex "set max_connections = 5000"-Batch

The above mentioned is only a fire-fighting method. MySQL provides another method to avoid the above problems to a certain extent.

MySQL provides the max_connections parameter to control the maximum number of connections, which includes the number of connections of all users. MySQL also provides another parameter max_user_connections to control the maximum number of connections of a user. For example, if you set this parameter to 50, you can create up to 50 connections for any user (including the Super User.

Therefore, we can formulate the following policy: If MySQL has three users (excluding root), set max_user_connections to 300 and max_connections to 1000. Configuration file:

Max_connections = 1000

Max_user_connection= 300

Because there are only three users and the maximum number of connections for a single user is 300, there are only 900 connections at most normally, and 100 additional connections will always be used by the root user.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.