Search code examples
mysqltimed-events

Triggering a MySQL procedure at a timed interval


I am wondering if there is a way to trigger a procedure by a timed interval. I am trying to create new tables dynamically and have the procedure written to do so, I just need a way to trigger it. I can easily write a python script and run it as a scheduled task. I am wondering if there is a way to do this within MySQL server. I know MS Server has server agent, I am wondering if MySQL server has something similar?

EDIT:

blockheads comment below worked. Should be noted that this only works on MySQL Server 5.1 or later

CREATE EVENT myEvent ON SCHEDULE EVERY INTERVAL 5 minutes DO CALL myProcedure();

Solution

  • Try the Event Scheduler