1SET @start_global_value = @@global.userstat; 2select @@global.userstat = 0 or @@global.userstat = 1; 3@@global.userstat = 0 or @@global.userstat = 1 41 5select @@session.userstat; 6ERROR HY000: Variable 'userstat' is a GLOBAL variable 7SET @@global.userstat=0; 8show global variables like 'userstat'; 9Variable_name Value 10userstat OFF 11show session variables like 'userstat'; 12Variable_name Value 13userstat OFF 14select * from information_schema.global_variables where variable_name='userstat'; 15VARIABLE_NAME VARIABLE_VALUE 16USERSTAT OFF 17select * from information_schema.session_variables where variable_name='userstat'; 18VARIABLE_NAME VARIABLE_VALUE 19USERSTAT OFF 20set global userstat=ON; 21select @@global.userstat; 22@@global.userstat 231 24set global userstat=OFF; 25select @@global.userstat; 26@@global.userstat 270 28set global userstat=1; 29select @@global.userstat; 30@@global.userstat 311 32set session userstat=1; 33ERROR HY000: Variable 'userstat' is a GLOBAL variable and should be set with SET GLOBAL 34set global userstat=1.1; 35ERROR 42000: Incorrect argument type to variable 'userstat' 36set global userstat=1e1; 37ERROR 42000: Incorrect argument type to variable 'userstat' 38set global userstat="foo"; 39ERROR 42000: Variable 'userstat' can't be set to the value of 'foo' 40SET @@global.userstat = @start_global_value; 41