想执行一个储存过程的脚本,mysql提示:
ERROR 1064 (42000) at line 3: 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我的做法如下:
1:创建一个test.sql脚本:
use db1;
DROP PROCEDURE  IF EXISTS `p1`;
CREATE PROCEDURE `p1`()
BEGIN
  SELECT 1+ 1;
END;
2:用mysql执行脚本:
/usr/local/mysql/bin/mysql -uroot -p <test.sql为什么呢?如果把test.sql脚本改为:
use db1;
DROP PROCEDURE  IF EXISTS `p1`;
CREATE PROCEDURE `p1`()
BEGIN
END;
是不会提示错误的!苍天啊!我的神啊!