I need to execute a query at giv开发者_高级运维en 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?
Have you turned on the Event Scheduler? Try:
SET GLOBAL event_scheduler = ON;
精彩评论