操作MySQL中interactive_timeout和wait_timeout

查询和设置

查询会话的变量

 show variables like 'interactive_timeout';
 show variables like 'wait_timeout';

在这里插入图片描述

一句话查询会话变量

select variable_name,variable_value from information_schema.session_variables where variable_name in ('interactive_timeout','wait_timeout');

在这里插入图片描述

设置会话变量

set session WAIT_TIMEOUT=10;
 set session INTERACTIVE_TIMEOUT=10;

查询全局变量

show global variables like 'wait_timeout';
show variables like 'interactive_timeout';

在这里插入图片描述

一句话查询全局变量

select variable_name,variable_value from information_schema.global_variables where variable_name in ('interactive_timeout','wait_timeout');

在这里插入图片描述

设置全局变量

set global wait_timeout=10;
set global interactive_timeout=10;
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章