From this SO question. I got confused with DELIMITER
. And I also tried something like following:
CREATE EVENT test
ON SCHEDULE EVERY 2 MINUTE
DO
BEG
Your answer lies in the docs here 21.1 Defining Stored Programs
If you use the
mysql
client program to define a stored program containing semicolon characters, a problem arises. By default,mysql
itself recognizes the semicolon as a statement delimiter, so you must redefine the delimiter temporarily to causemysql
to pass the entire stored program definition to the server.