工具: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 = ‘[email protected]‘; //事件操作
程序员必然觉得好简单,这也需要记录?
时间: 2024-11-10 07:42:30