MySQL 创建定时任务

查看是否开启

show variables like '%sche%';

开启

set global event_scheduler =1;

查看已经存在的定时任务

SELECT * FROM information_schema.EVENTS;

 

use database;

create event test
on schedule every 60 second
do

[something];

 

UPDATE Files SET usr_id=8362 WHERE usr_id=0 AND file_created BETWEEN '2018-01-16 00:00:00.000000' AND '2019-01-02 08:00:00.000000'

 

via https://segmentfault.com/a/1190000005142597

发表评论

电子邮件地址不会被公开。 必填项已用*标注