Klark
Klark

Reputation: 8280

mysql time events aren't executed

I need to execute a query at given time. I read about mysql events, and they seemed as a way to go. I made this test example:

CREATE EVENT deleteUserJourney
    ON SCHEDULE AT '2011-02-05 13:16:00'
    DO
      DELETE FROM User_has_Journey WHERE idSell=7;

But at the given time nothing happened. Mysql time is ok (at least NOW() returns correct value) event creation query didn't return any errors/warnings. The strange thing is that I cannot create new Event with the same name, although I read that events should be destroyed after they are executed.

If it is important, the mysql version is:

mysql --version
mysql  Ver 14.14 Distrib 5.1.41, for debian-linux-gnu (x86_64) using readline 6.1

What am I doing wrong?

Upvotes: 0

Views: 153

Answers (1)

a'r
a'r

Reputation: 37009

Have you turned on the Event Scheduler? Try:

SET GLOBAL event_scheduler = ON;

Upvotes: 1

Related Questions