Solve the Problem of MYSQL 8-hour connection

Source: Internet
Author: User

It is unknown that the connection has expired. If a Client requests a connection, providing the Connection to the Client will cause the above exception.

8 hours in idle status.
;
Set global wait_timeout =;

Mysql> show variables like '% timeout % ';
+ -------------------------- + ------- +
| Variable_name | Value |
+ -------------------------- + ------- +
| Connect_timeout | 5 |
| Delayed_insert_timeout | 300 |
| Innodb_lock_wait_timeout | 50 |
| Interactive_timeout | 28800 |
| Net_read_timeout | 30 |
| Net_write_timeout | 60 |
| Slave_net_timeout | 3600 |
| Wait_timeout | 28800 |
+ -------------------------- + ------- +
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.

Set these two parameters to 1 year (60*60*24*365 = 31536000)

Set interactive_timeout = 31536000;
Set wait_timeout = 31536000;

MySQL times out idle connections after 8 hours (28,800 seconds)
MySQL idle timeout


 
 




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.