检测事件是否开启
1
|
show variables like 'event_scheduler' ;
|
开启事件
1
|
set global event_scheduler = on;
|
创建一个存储过程
1
2
3
4
5
|
delimiter //
create procedure test()
begin
update test fdCreate = now();
end ;
|
创建一个事件
1
2
3
4
|
create event if not exists e_test
on schedule every 30 second
on completion preserve
do call test();
|
关闭或开启执行事件
1
|
alter event event_name on completion preserve [enable | disable]
|
删除事件
1
|
drop event event_name;
|
0则评论给“mysql事件操作”