当你发现这种报错时:You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 3
不要忘记定义 delimiter ,也许你的IDE不支持mysql存储过程的默认定义功能。
delimiter //
create procedure test1()
begin
declare a int;
set a = 111;
select a;
end;
//