操作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;
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章