mysql计划任务一例

发布时间:2020-08-29编辑:脚本学堂
mysql计划任务一例,供大家学习参考。

mysql计划任务一例,供大家学习参考。

复制代码 代码如下:

use dbname

delimiter //

drop event if exists e_Dayly//

CREATE EVENT e_Dayly
ON SCHEDULE
EVERY 1 DAy STARTS '2010-10-19 02:00:00' ENDS '2012-10-19 02:00:00'
DO
begin
insert dbname.productbak (select * from youhuisou.products where (dbname.products.ExpireTime<=NOW()));
delete from products where (dbname.products.ExpireTime<=NOW());
end;

//
delimiter;

其它的相关命令:
 

复制代码 代码如下:
show processlistg
show variables like '%sche'g
set global event_scheduler = ONg

所有的event是放在information_schema.events表中。