不写
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;
复制代码