修改mysql数据库的休眠时间
1.查看当前休眠时间(默认为八个小时,单位是秒)
mysql> show global variables like 'wait_timeout';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| wait_timeout | 28800 |
+---------------+-------+
1 row in set (0.01 sec)
mysql> show session variables like 'wait_timeout';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| wait_timeout | 28800 |
+---------------+-------+
1 row in set (0.00 sec)
2.修改休眠时间(一个小时)
mysql> set global wait_timeout = 3600;
Query OK, 0 rows affected (0.00 sec)
mysql> set session wait_timeout = 3600;
Query OK, 0 rows affected (0.00 sec)