mysql creates timed storage tasks

The scheduling task of the database is realized through the timing execution of mysql events

The timed event syntax for creating mysql is

CREATE  EVENT `test_event`
ON SCHEDULE EVERY 5 SECOND STARTS now()
ON COMPLETION NOT PRESERVE ENABLE
DO CALL `myProcedure`

on schedule every 5 second means to execute every 5 seconds

starts now() means start now

on completion not preserve enable means that when the event expires, the event will be automatically deleted

do sql statement means to execute specific content

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324972507&siteId=291194637