MySQL分隔符语法错误 [英] MySQL delimiter syntax error
问题描述
我正在尝试更改MySQL命令定界符,以便可以在其中创建包含多个命令的过程.但是,在MySQL 5.1.47上似乎无法识别delimiter命令.我在MySQL 5.0.91上对其进行了测试,并且确实可以在其中工作.
I'm trying to change the MySQL command delimiter so I can create a procedure with multiple commands in it. However, the delimiter command does not seem to be recognised on MySQL 5.1.47. I tested it on MySQL 5.0.91, and it did work there.
DELIMITER //;
DELIMITER ;//
在两种情况下,我都试图从phpmyadmin运行它.不能选择使用5.0.91,因为我需要使用事件(CREATE EVENT
).
I'm trying to run this from phpmyadmin, in both situations. Using 5.0.91 instead isn't an option because I need to use events (CREATE EVENT
).
错误消息:
#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 //' at line 1
是因为它不起作用,还是有另一种方法可以完成同一件事(创建具有多个查询的过程)?
Is there a reason it's not working, or is there an alternative to accomplish the same thing (creating a procedure with multiple queries)?
推荐答案
DELIMITER
不是MySQL命令.这是您的MySQL客户端需要支持的命令.我正在运行不支持它的PHPMyAdmin 2.8.2.4.当我升级到最新版本(当前为3.4.9)时,它就可以正常工作.您的MySQL版本与DELIMITER
和是否受支持无关.
DELIMITER
is not a MySQL command. It's a command that your MySQL client needs to support. I was running PHPMyAdmin 2.8.2.4, which didn't support it. When I upgraded to the newest version, which is currently 3.4.9, it worked just fine. Your MySQL version has nothing to do with DELIMITER
and whether it's supported or not.
这篇关于MySQL分隔符语法错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!