Welcome to OGeek Q&A 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 Reply

0 votes
by (71.8m points)

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...