方法一:
mysql> set global wait_timeout=864000;
mysql> show global variables like 'wait_timeout';
+---------------+--------+
| Variable_name | Value |
+---------------+--------+
| wait_timeout | 864000 |
+---------------+--------+
方法二:
vi /etc/my.cnf文件,在[mysqld]下方添加文字:
wait_timeout=864000