mysql简单的job

1.创建存储过程

CREATE PROCEDURE updateGatwxLiveStatus()
BEGIN
UPDATE gatwxlive


SET STATUS = '3'
WHERE 1=1
and `status`='1'
and liveurl='404';
END;
2.查看job是否已开
show VARIABLES LIKE '%sche%';

SET GLOBAL event_scheduler = 1;

3.创建 job
drop event if exists changeStatus;
create event changeStatus
on schedule every 60 second
on completion preserve disable
do call updateGatwxLiveStatus();
4.启动job
alter event changeStatus on completion preserve

posted @ 2017-08-29 18:05  周存双  阅读(2067)  评论(0)    收藏  举报