The solution of Mysql "Too many connections"

Source: Internet
Author: User

The number of connections exceeds the value set by MySQL and is related to both max_connections and wait_timeout. The larger the value of the wait_timeout, the longer the idle wait for the connection, which causes the current number of connections to become larger.

windows resolves MySQL Errno.: 1040 Error
XXXX Info:can not connect to MySQL server
User:root
Time:2004-5-20 3:00pm
Script:/xxxx/xxxx.php
Error:too Many connections
Errno.: 1040
An error in the has been dispatched to our administrator.


Workaround:

Modify the parameters in the MySQL configuration file (My.ini under Windows, MY.CNF under Linux):

The code is as follows Copy Code

max_connections= 1000
Wait_timeout = 5

If you cannot add it yourself, restart MySQL after you modify it.


If it is the Linux system we modify

/ETC/MYSQL/MY.CNF, add the following line:

The code is as follows Copy Code
Set-variable = max_connections=500

Or add parameters to the startup command max_connections=500

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.