
ENABLE/DISABLE/DISABLE ON SLAVE
-------------------------------

Events are ENABLEd by default. If you want to stop MariaDB from executing an
event, you may specify DISABLE. When it is ready to be activated, you may
enable it using ALTER EVENT. Another option is DISABLE ON SLAVE, which
indicates that an event was created on a master and has been replicated to the
slave, which is prevented from executing the event. If DISABLE ON SLAVE is
specifically set, the event will be disabled everywhere. It will not be
executed on the mater or the slaves.

COMMENT
-------

The COMMENT clause may be used to set a comment for the event. Maximum length
for comments is 64 characters. The comment is a string, so it must be quoted.
To see events comments, you can query the INFORMATION_SCHEMA.EVENTS table (the
column is named EVENT_COMMENT).

Examples
--------

Minimal CREATE EVENT statement:

CREATE EVENT myevent
  ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 HOUR
  DO
   UPDATE myschema.mytable SET mycol = mycol + 1;

An event that will be triggered tomorrow at a certain time:

CREATE EVENT example
ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 DAY + INTERVAL 3 HOUR
DO something;

Next month a recurring event will be triggered hourly for a week:

CREATE EVENT example
ON SCHEDULE EVERY 1 HOUR
STARTS CURRENT_TIMESTAMP + INTERVAL 1 MONTH
ENDS CURRENT_TIMESTAMP + INTERVAL 1 MONTH + INTERVAL 1 WEEK
DO some_task;

OR REPLACE and IF NOT EXISTS:

CREATE EVENT myevent
  ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 HOUR
  DO
   UPDATE myschema.mytable SET mycol = mycol + 1;
ERROR 1537 (HY000): Event 'myevent' already exists

CREATE OR REPLACE EVENT myevent
  ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 HOUR
  DO
   UPDATE myschema.mytable SET mycol = mycol + 1;;
Query OK, 0 rows affected (0.00 sec)

CREATE EVENT IF NOT EXISTS myevent
  ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 HOUR
  DO
   UPDATE myschema.mytable SET mycol = mycol + 1;
Query OK, 0 rows affected, 1 warning (0.00 sec)

SHOW WARNINGS;
+-------+------+--------------------------------+
| Level | Code | Message                        |
+-------+------+--------------------------------+
| Note  | 1537 | Event 'myevent' already exists |
+-------+------+--------------------------------+

URL: https://mariadb.com/kb/en/create-event/