MySQL – Scheduling an Event Every Day at a Given Time

eventMySQL

I want my event to run everyday at 00:20. I am confused in scheduling of the time. Should I be using the first option or the second one?

Option 1

CREATE EVENT my_event
  ON SCHEDULE
    EVERY 1 DAY
    STARTS '2014-04-30 00:20:00' ON COMPLETION PRESERVE ENABLE 
  DO
    # My query

Option 2

CREATE EVENT my_event
  ON SCHEDULE
    AT ('2014-04-30 00:20:00'+ INTERVAL 1 DAY) ON COMPLETION PRESERVE ENABLE 
  DO
    # My query

Best Answer

Use the first one if you want to execute your event everyday.

The second syntax will execute once.

Option 1: Execute the event every night at 00:20

Option 2: Execute the event once the 2014-05-01 at 00:20

Max.