mysql实现定时执行sql语句

  sre, 开发

检查event事件是否开启
show variables like ‘%sche%’;
如果Value值为OFF,则需要开启
set global event_scheduler=1;
在my.cnf中mysqld域增加:
event_scheduler = 1

通过调用存过实现:
CREATE PROCEDURE test ()
BEGIN
delete rows where expire_time

LEAVE A COMMENT

Captcha Code