CREATE PROCEDURE InitializationData() BEGIN update yt_products set number=number+100 where id=1; update yt_products set number=number+100 where id=2; update yt_products set number=number+100 where id=3; update yt_products set number=number+50 where id=4; update yt_products set number=number+1 where id=5; update yt_products set number=number+1 where id=6; update yt_products set number=number+1 where id=7; update yt_products set number=number+1 where id=8; update yt_products set number=number+10 where id=9; update yt_products set number=number+10 where id=10; update yt_products set number=number+10 where id=11; update yt_products set number=number+10 where id=12; update yt_products set number=number+5000 where id=13; update yt_products set number=number+6000 where id=14; END;
然后创建事件
CREATE EVENT `NewEvent` ON SCHEDULE EVERY 1 DAY STARTS '2015-04-01 17:49:10' ON COMPLETION NOT PRESERVE ENABLE DO CALL InitializationData();
事件的意思是 从17:49:10 这个时间开始 每天 这个点执行这个事物
时间: 2024-10-07 07:54:41