欢迎投稿

今日深度:

解决MYSQL 8小时连接问题

解决MYSQL 8小时连接问题


并不知道该connection已经失效,如果这时有 Client请求connection,将该失效的Connection提供给Client,将会造成上面的异常。 

mysql/my.cnf 文件,在 [mysqld] 节中设置:

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 |
+--------------------------+-------+         
同一时间,这两个参数只有一个起作用。到底是哪个参数起作用,和用户连接时指定的连接参数相关,缺省情况下是使用wait_timeout。我建议是将这两个参数都修改,以免引起不必要的麻烦。

8小时(60*60*8=28800)。

将这2个参数设置为1年(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



MySQL raise exception after a long idle time







www.htsjk.Com true http://www.htsjk.com/shujukunews/156.html NewsArticle 解决MYSQL 8小时连接问题 并不知道该connection已经失效,如果这时有 Client请求connection, 将该失效的Connection提供给Client,将会造成上面的异常。 mysql /my.cnf文件,在 [mysqld] 节中设置: 8...
相关文章
    暂无相关文章
评论暂时关闭