MySQL delimiter syntax error

前端 未结 2 2109
情歌与酒
情歌与酒 2020-12-16 19:59

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

相关标签:
2条回答
  • 2020-12-16 20:39

    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.

    0 讨论(0)
  • 2020-12-16 20:52

    You don't need to delimit the DELIMIT statements

    DELIMITER //
    
    procedure here etc
    
    DELIMITER ;
    

    Exactly as per "Defining Stored Programs" in the MySQL docs.

    And if you can control versions, the latest is 5.5.20. Why not use that?

    Edit:

    The error message indicates an error in the previous statement... if this can't be seem force it thus

    ; /* <- force previous statement termination */ DELIMITER //
    
    procedure here etc
    
    DELIMITER ;
    
    0 讨论(0)
提交回复
热议问题