wangming1993 / issues

记录学习中的一些问题,体会与心得 https://wangming1993.github.io/issues
8 stars 4 forks source link

mysql 定时器使用 #85

Open wangming1993 opened 6 years ago

wangming1993 commented 6 years ago
delimiter //
drop procedure if exists test_proce//
create procedure test_proce()
begin
update `activity_groups` set createdAt = now() where id = 1;
end//
delimiter ;

drop event if exists test_event;
create event test_event
on schedule every 3 second
on completion preserve disable
do call test_proce();

alter event test_event on completion preserve enable;

select * from mysql.event;

delete from `mysql`.`event` where `db`='db' and `name`='test_event';
wangming1993 commented 5 years ago
SELECT  *  FROM  information_schema.Routines WHERE ROUTINE_SCHEMA = 'admin-server';