1.开启事件
SET GLOBAL event_scheduler = 1;
2.看事件是否开启
SHOW VARIABLES LIKE 'event_scheduler';
3.添加事件
CREATE EVENT myevent ON SCHEDULE EVERY 1 DAY DO
UPDATE yasijob_company_job
SET lastupdate = (
SELECT
UNIX_TIMESTAMP(now())
);
4.删除事件
DROP EVENT IF EXISTS myevent;