标签:
如何建议一个数据库内的定时任务
工具:navicat工具
查看event是否开启: show variables like ‘%sche%‘;
将事件计划开启: set global event_scheduler=1;
开户事件任务: alter event e_test ON COMPLETION PRESERVE ENABLE;
关闭事件任务: alter event e_test ON COMPLETION PRESERVE DISABLE;
创建event e_test
navicat工具的交互设定:
定义事件的语句:
CREATE DEFINER=`root`@`%` //定义者
EVENT `NewEvent`
ON SCHEDULE EVERY 10 MINUTE STARTS ‘2016-10-10 11:34:40‘ //定义计划
ON COMPLETION NOT PRESERVE
ENABLE //开启事件任务
DO
delete FROM zkread.user where email = ‘zhaikeread@163.com‘; //事件操作
程序员必然觉得好简单,这也需要记录?
标签:
原文地址:http://www.cnblogs.com/lsjdddddd/p/5946191.html