How to schedule a stored procedure in MySQL

后端 未结 4 1220
抹茶落季
抹茶落季 2020-11-27 12:08

I have this stored procedure. How can I run this for example with intervals of 5 seconds? Like a routine for eliminate data with a time-stamp older than one day?

<         


        
4条回答
  •  自闭症患者
    2020-11-27 12:27

    You can use mysql scheduler to run it each 5 seconds. You can find samples at http://dev.mysql.com/doc/refman/5.1/en/create-event.html

    Never used it but I hope this would work:

    CREATE EVENT myevent
        ON SCHEDULE EVERY 5 SECOND
        DO
          CALL delete_rows_links();
    

提交回复
热议问题