Mysql automatically disconnects links that have not been used for 8 hours

Source: Internet
Author: User

Mysql solves the problem of automatic disconnection of connections that have not been used for nearly eight hours, I have done some experiments on this issue. The results of the study on mysql automatic disconnection at www.2cto.com are as follows. There are related parameter settings in mysql. When the database connection is idle for a certain period of time, the server will disconnect the connection waiting for Timeout: At the same time, only one of these two parameters works. Which parameter takes effect depends on the connection parameter specified during user connection. wait_timeout is used by default. I suggest modifying both parameters to avoid unnecessary troubles. 2. Modify the parameters. The default value is 8 hours. I tested changing these two parameters to 0, and the result is unexpected. The system automatically sets this value to 1. In other words, you cannot set this value to permanent. We recommend that you add three zeros to the parameter value to meet our application requirements. Modify www.2cto.com: Open/etc/my. cnf: Add the following parameters to the attribute group mysqld: [mysqld] interactive_timeout = 28800000wait_timeout = 28800000 windows in my. added in ini: interactive_timeout = 28800000wait_timeout = 28800000

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.