First page Back Continue Last page Image

The Syntax of a MySQL Event

CREATE EVENT event_name

ON SCHEDULE

DO event_body

Schedule Options

AT timestamp

EVERY interval

STARTS timestamp + INTERVAL interval

ENDS timestamp

Interval Options

YEAR | QUARTER | MONTH | DAY | HOUR | MINUTE |

WEEK | SECOND | YEAR_MONTH | DAY_HOUR | DAY_MINUTE |

DAY_SECOND | HOUR_MINUTE | HOUR_SECOND | MINUTE_SECOND

So very similar to a Linux/Unix Crontab job you have the option to specify an event time by a a date and time (Timestamp) or a recurring event by specifying the recurring interval:

Sample Timestamp Options

NOW()

’2022-01-20’