MySQL expired in 8 hours

Source: Internet
Author: User

1. Problem Description

2. Solution


====================================== Lili's line ========


1. Problem Description

The project is deployed on the server and runs properly. However, after waking up the next day, Tomcat is automatically disabled. Check the Tomcat log and find that the Tomcat server is closed after more than eight hours...

I searched the internet for the root cause, which is basically the same answer. MySQL automatically closes the service eight hours later. the project uses the SSH framework. hibernate 3.0 does not automatically check whether the MySQL link is valid. therefore, if no one accesses MySQL within 8 hours, the link becomes invalid. If another user accesses MySQL, Tomcat is automatically disabled to prevent memory overflow.

Here, it is nothing more than modifying the project or extending the expiration time of the link for modifying MySQL.


====================================== Lili's line ========


2. Solution

1. Modify the link expiration time of MySQL, find the MySQL my. ini file. Open it, and add the following at the bottom:

 
[Mysqld] wait_timeout = 31536000interactive_timeout = 31536000

Note: The unit here is second. The default value is 28000 (8 hours)

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.