1、檢測事件是否開啟
show variables like 'event_scheduler';
2.開啟事件
set global event_scheduler = on;
3.創建一個存儲過程
delimiter // create procedure test() begin update project set create_time = now(); end;
4.創建一個事件
create event if not exists e_test on schedule every 30 second on completion preserve do call test();
5.關閉或開啟執行事件
alter event event_name on completion preserver [enable | disable]
6.刪除事件
drop event event_name;