不寫
session
, 默認局部變量mysql
show variables;
show session variables;
show global variables;
複製代碼
show variables like 'auto%';
show variables like 'auto%';
show session variables like 'auto%';
show session variables like 'auto%';
show global variables like 'auto%';
show global variables like 'auto%';
複製代碼
select @@autocommit;
select @@session.autocommit;
select @@global.autocommit;
複製代碼
不寫
session
默認 局部變量sql
set @@autocommit = 0;
set @@session.autocommit = 0;
set @@global.autocommit = 0;
set autocommit = 0;
set session autocommit = 0;
set global autocommit = 0;
複製代碼
set @hello = 1;
select @hello;
複製代碼
begin end
中有效)create procedure test() begin
declare x int default = 0;
select x;
end;
複製代碼