查看mysql server超时时间:
MariaDB [(none)]> use xspeeder;
MariaDB [xspeeder]> show global variables like '%timeout%';
+----------------------------+----------+
| Variable_name | Value |
+----------------------------+----------+
| connect_timeout | |
| deadlock_timeout_long | |
| deadlock_timeout_short | |
| delayed_insert_timeout | |
| innodb_lock_wait_timeout | |
| innodb_rollback_on_timeout | OFF |
| interactive_timeout | |
| lock_wait_timeout | |
| net_read_timeout | |
| net_write_timeout | |
| slave_net_timeout | |
| thread_pool_idle_timeout | |
| wait_timeout | |
+----------------------------+----------+
设置超时时间,临时生效(以秒为单位):
msyql> set global wait_timeout=;
msyql> set global interactive_timeout=;
修改配置文件/etc/my.cnf.d/server.conf
在 [mysqld]下添加
wait_timeout=86400
默认超时时间是28800即8个小时
86400为24个小时