1) phpmyadmin:
a.开启事件
b.运行sql语句
CREATE EVENT `yl_change_order_status`
ON SCHEDULE EVERY 10 SECOND STARTS ‘2018-02-07 00:00:00‘
ON COMPLETION PRESERVE
DO UPDATE yl_order SET yl_order_status=4 WHERE `yl_order_chat_endtime`<unix_timestamp(now());
2) navicat
a.查看定时任务是否开启(event_scheduler)
show variables like ‘%sche%‘;
若未开启, set global event_scheduler = ON
b.创建函数
c.创建事件并保存
CALL 函数名()
end....
注:PRESERVE 事件结束保存事件
NOT PRESERVE 事件结束删除事件
参考链接:http://blog.csdn.net/only_lamp/article/details/47659995