问题描述:

发现日志中总是报这么个warn:

Possibly consider using a shorter maxLifetime value.

解决思路:
其中的Dataxxxx中的xxxx是数据库端口号。根据日志中提示,应该是maxlifetime值太大,看项目中配置是默认的180000,参考其他帖子说maxlifetime小于数据库配置参数timeout应该不少于30,于是再次将以上两个值改为300。

改后如下:

mysql> show variables like "%timeout%";
+-----------------------------+----------+
| Variable_name               | Value    |
+-----------------------------+----------+
| connect_timeout             | 10       |
| delayed_insert_timeout      | 300      |
| have_statement_timeout      | YES      |
| innodb_flush_log_at_timeout | 1        |
| innodb_lock_wait_timeout    | 20       |
| innodb_rollback_on_timeout  | OFF      |
| interactive_timeout         | 300      |
| lock_wait_timeout           | 31536000 |
| net_read_timeout            | 30       |
| net_write_timeout           | 60       |
| rpl_stop_slave_timeout      | 31536000 |
| slave_net_timeout           | 3600     |
| wait_timeout                | 300      |
+-----------------------------+----------+
13 rows in set (0.00 sec)

问题解决!
 

更多推荐

Possibly consider using a shorter maxLifetime value.问题处理