The solution to the linkfailure problem caused by mysql not being accessed for a long time. _ MySQL

Source: Internet
Author: User
The solution to the linkfailure problem caused by mysql not being accessed for a long time. I have developed an ssh-based system that uses mysql, but a strange problem occurs. every time I access the system and use it again the next day, an error will occur, check the error log, and the problem of mysql link failure occurs. later, I searched for relevant information on the Internet and explained that mysql will be automatically disconnected after the connection lasts for more than 8 hours. I have said that I modified the timeout on the Internet, I have tried to add autoreconnect and have not solved the problem. Later, I finally found the root cause in an article. mysql was disconnected for 8 hours and the connection pool was not disconnected. when we went to access the system the next day, the system still obtained data from the connection pool, in fact, mysql has been disconnected, so an error occurs when obtaining data. I configured the connection pool and database connection, and released the idle connection in time to solve the problem. For specific configuration, see the following:




The following attributes are used to configure when to release a connection:


You can set this time parameter by yourself, hoping to help your friends who encounter the same 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.