MYSQL 在创建定时执行任务EVENT

1、首先检查event是否开启

SELECT @@event_scheduler;

2、如果没有开启,则需要开启--临时开启如下

SET GLOBAL event_scheduler = ON ;

SET @@ global .event_scheduler = ON ;

SET GLOBAL event_scheduler = 1; — 0代表关闭

SET @@ global .event_scheduler = 1;

 

3、创建even

CREATE EVENT deleteIllegalShipmentWarningTask1 ON SCHEDULE EVERY 60 SECOND DO DELETE FROM ec_task WHERE `name` = '违规出货预警任务'

 

posted @ 2020-10-12 11:47  苏州coder  阅读(222)  评论(0编辑  收藏  举报