mysql 程序未使用 phpmyadmin 创建/工作
我使用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您需要在分隔符后留出空格。所以替换
分隔符
;使用delimiter ;
或者你可以尝试,You need to give space after delimiter. SO replace
delimiter
; withdelimiter ;
or you can try,问题是您的 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.