Recurring Mysql Events

I am trying to update my table after every 24 hours, I have tried the following examples, but event triggers only once

CREATE EVENT mydb.time_sync
    ON SCHEDULE
      EVERY '1 0' DAY_HOUR       
    STARTS '2013-01-16 16:53:00' 
    DO
      UPDATE mydb.mytable SET is_time_sync = 0;

I tried another one, but it only repeats once again

CREATE EVENT mydb.time_sync2
    ON SCHEDULE
      EVERY 24 DAY_HOUR       
    DO
      UPDATE mydb.mytable SET is_time_sync = 0;

this failed only once

CREATE EVENT mydb.time_sync3
ON SCHEDULE EVERY '1' DAY
STARTS '2013-01-16 16:53:00' 
DO
      UPDATE mydb.mytable SET is_time_sync = 0;

I am using mysql 5.5 and the event scheduler is enabled.

+3


source to share


1 answer


Mr. Umair your request for the event you are writing is ok ... but there is one thing you are missing. You have not included an event scheduler that only calls the trigger to run once ... so you include that you need to write event_scheduler = somewhere in the [mysqld] section in your default mysql config file, usually /etc/my.cnf or my .ini



0


source







All Articles