mysql 程序未使用 phpmyadmin 创建/工作

发布于 2024-10-11 12:30:49 字数 844 浏览 0 评论 0原文

我使用 phpmyadmin + mysql 版本 5.0.77 创建了以下存储过程,但未按预期工作......并显示以下错误。

存储过程:

delimiter //
create procedure myProc()
begin
  select name from main_contacts;
end //
delimiter;
Error

There seems to be an error in your SQL query. 
The MySQL server error output below, 
if there is any, may also help you in diagnosing the problem

ERROR: 

Unknown Punctuation String @ 11
STR: //
SQL: delimiter //
create procedure myProc()
begin
select name from main_contacts
SQL-query :  

delimiter // create procedure myProc() begin select name from main_contacts 

MySQL said: 


#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 'delimiter //
create procedure myProc()
begin
select name from main_contacts' at line 1

I have created the following stored procedure using phpmyadmin + mysql version 5.0.77 but not working as expected.....and showing the below error.

Stored Procedure:

delimiter //
create procedure myProc()
begin
  select name from main_contacts;
end //
delimiter;
Error

There seems to be an error in your SQL query. 
The MySQL server error output below, 
if there is any, may also help you in diagnosing the problem

ERROR: 

Unknown Punctuation String @ 11
STR: //
SQL: delimiter //
create procedure myProc()
begin
select name from main_contacts
SQL-query :  

delimiter // create procedure myProc() begin select name from main_contacts 

MySQL said: 


#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 'delimiter //
create procedure myProc()
begin
select name from main_contacts' at line 1

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

岁月无声 2024-10-18 12:30:49

您需要在分隔符后留出空格。所以替换分隔符;使用 delimiter ; 或者你可以尝试,

delimiter //
    create procedure myProc()
    begin
      select name from main_contacts;
    end //
    delimiter ;

You need to give space after delimiter. SO replace delimiter; with delimiter ; or you can try,

delimiter //
    create procedure myProc()
    begin
      select name from main_contacts;
    end //
    delimiter ;
时光无声 2024-10-18 12:30:49

问题是您的 MySQL 客户端不喜欢 DELIMITER 命令。如果您使用的是旧版本的 phpMyAdmin,请使用新版本,因为该问题已在 phpMyAdmin 中得到解决。如果您可以使用 MySQL 客户端 mysql,那也应该可以解决您的问题。

如果您无法使用旧版本的 phpMyAdmin,并且不能或不想使用 mysql,请查看 Nate Smith 在 Nth Design 网站上的建议...

http://blog.nth-design.com/2009/02/25/creating- sp-in-phpmyadmin/

希望这有帮助。

The problem is that your MySQL client doesn't like the DELIMITER command. If you're using an older version of phpMyAdmin, use a new one, since the issue has been resolved in phpMyAdmin. If you can use the MySQL client mysql, that should solve your problem, too.

If you're stuck using an older version of phpMyAdmin, and you can't or don't want to use mysql, check out this advice from Nate Smith on the Nth Design web site...

http://blog.nth-design.com/2009/02/25/creating-sp-in-phpmyadmin/

Hope this helps.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文