How to run a MYSQL query on a pre-defined fixed time?

后端 未结 3 1378
夕颜
夕颜 2021-01-06 16:40

I have a Mysql insert query. I need to run the query everyday, at 11:00 AM.

How do I execute a query on a fixed time in MySQL?
In MS-SQL i can easily do it by S

3条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-06 17:01

    You can use the event scheduler to achieve the above purpose in Mysql.

    To create an event, you can use the create event statement. Here is an explanation with example.

    Something like this:

    CREATE EVENT e_totals
    ->     ON SCHEDULE AT '2006-02-10 23:59:00'
    ->     DO INSERT INTO test.totals VALUES (NOW());
    

提交回复
热议问题