在mysql配置文件里添加wait_timeout和interactive_timeout两个值
[mysqld] wait_timeout=315360000 interactive_timeout=315360000
超时时间,10年
重启mysql,
登入mysql
show variables like '%timeout%';
+-----------------------------+----------+
| Variable_name | Value |
+-----------------------------+----------+
| interactive_timeout | 31536000 |
| wait_timeout | 31536000 |
+-----------------------------+----------+
13 rows in set (0.00 sec)
看到值已经改变,设置成功