The MySQL connection too connector connection is incorrect and the start time is too long.

Source: Internet
Author: User

This article describes how to solve the "too connection \" error during MySQL connection and the startup time is particularly long. For more information, see.

Yesterday, a strange problem occurred on a server. During normal access, MySQL encountered an error message "error 1040, too transaction connection, this is usually because max_connections is set too small or the wait_timeout value is set too long, resulting in too long connection timeout. So the first thing that comes to mind is to use mysqladmin to check the value of max_connections.

The cause of this problem is:

The number of connections exceeds the value set by MySQL. It is related to max_connections and wait_timeout. The larger the value of wait_timeout, the longer the idle waiting time for the connection, which leads to the larger number of current connections.

Solution:

The Code is as follows: Copy code

1. [root @ localhost bin] $./mysqladmin-uroot-p variables | grep "max_conn"

After entering the database password, you can see the value of max_connections. If it is too small (the default value is 100), you need to set this value to a greater value. If MySQL cannot be interrupted, log on to MySQL and set the current max_connections value.

The Code is as follows: Copy code

1. [root @ localhost bin] $./mysql-uroot-p
2. mysql> set GLOBAL max_connections = 1024;


In Linux, if the max user processes of the system is lower than the value of max_connections, the error "Can't create a new thread (errno 11);" appears, for the solution, refer to the solution for MySQL to show Can't create a new thread (errno 11. The above settings are only valid in the current running status. If the settings become invalid after mysql is restarted, the ultimate method is to modify the mysql configuration file my. cnf, and then set the max_connections value under [mysqld.

However, it is strange that the error still persists after this setting. Therefore, after logging on to mysql, run the show processlist command to view the connection, and then run the kill command to delete some Sleep connections, however, after a while, the too transaction connection error message will appear. In addition, I also noticed that MySQL started or restarted for a very long time. The database may have about 2 GB of data, but it won't be so slow to start? Later, I thought about whether there was a problem with the database file, so I used the repair command to fix each table. However, after an hour or two, the above error will still occur.

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.