1.創建存儲過程 CREATE PROCEDURE updateGatwxLiveStatus() BEGIN UPDATE gatwxlive SET STATUS = '3'WHERE 1=1and `status`='1'and liveurl='404'; END;2.查看job是否已開 s ...
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