Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
3.2k views
in Technique[技术] by (71.8m points)

MySQL事件设置问题

在MySQL设置了一个定时执行的事件,每天晚上23:55执行,但是看information.events表的执行结果发现最后一次执行时间是15:55,请问是什么原因?如果是时区的问题,我用select now()看到跟当前事件是对的上的
image.png
image.png

CREATE DEFINER=code@% EVENT NewEvent ON SCHEDULE EVERY 1 DAY STARTS '2021-01-06 23:55:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
UPDATE growth SET settle = 1 WHERE clubId in (SELECT clubId from club_ranking_ignore) AND settle = 0;


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

你在创建 schedule 的时候,starts 后面的时间,你是用带时区的时间格式写入吧.比如 RFC3339


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...