Mysql:communications Link Failure problem

Source: Internet
Author: User
Tags mysql connection pool

When accessing the MySQL database, the project often appears communications link failure error, which seems to be an idle connection over the database settings "Wait_timeout", MySQL will be out of the connection, The MySQL connection pool also considers the connection to be valid (the parameters for MySQL's wait_timeout settings are inconsistent with the timeout time of the connection pool settings, Wait_timeout > The time set by the connection pool), so the error occurs

Online look at a variety of methods, feel more reliable solution

First: On the URL of the connection database, add the parameter &autoreconnect=true&failoverreadonly=false

Second:

Modify MY.CNF: (my.cnf not found, directly changed My.ini file)

[Mysqld]

wait_timeout=31536000

interactive_timeout=31536000

Do you have any other ways to solve the problem?

There is also a problem, such as the problem shown above, why the feeling that the problem occurs and there is no fixed cycle, and the feeling is random appearance. And another question to ask is how MySQL distributes connections and how different connections differ. Will each connection be assigned a connection?



Mysql:communications Link Failure problem

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.