【mysql报错】1064 - You have an error in your SQL syntax;

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/debimeng/article/details/85050845

mysql 报错1064 - You have an error in your SQL syntax;

数据库版本:mysql5.7;系统版本:CentOS Linux7.5

场景:
执行下面的存储过程
CREATE PROCEDURE pro_dw_gs()
BEGIN
select * from ods_ban_nnn;
END

报错如下:
CREATE PROCEDURE pro_dw_gs()
BEGIN
select * from ods_ban_nnn
1064 - 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
时间: 0.001s

解决:
在存储过程前后添加DELIMITER //和// DELIMITER ;

正确的存储过程为:
DELIMITER //
CREATE PROCEDURE pro_test_nnn()
BEGIN
select * from ods_ban_nnn;
END
//
DELIMITER ;

猜你喜欢

转载自blog.csdn.net/debimeng/article/details/85050845