In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article shares with you the content of a sample analysis of event scheduled tasks in MySQL. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
First, check whether event is enabled.
Show variables like'% sche%'
Set global event_scheduler = 1
II.
-- set the time zone and set the scheduled event scheduler to open, or event_scheduler = ON
Set time_zone ='+ 8VR 00'
Set GLOBAL event_scheduler = 1
-- sets the database base database that the event uses or belongs to
Use test
-if a task schedule with that name exists, delete it first
Drop event if exist test_update
-- set the delimiter to'$$'and the default statement delimiter in mysql to';', so that the subsequent code from create to end will be executed as a statement
DELIMITER $$
-- create a scheduled task, set the time for the first execution to '2012-11-15, 10-10, 00-00, and execute it once a day
-- on schedule every 30 second
-- on schedule every day starts timestamp '2012-11-15 10 purl 0000'
Create event test_update
On schedule every day starts timestamp '2012-11-15 10 0000'
Do
Start what the planned task needs to do.
Begin
-
-- do something write what you plan your tasks to do
-
-- end the planned task
End $$
-- set the statement separator back to';'
DELIMITER
Thank you for reading! This is the end of this article on "sample Analysis of event Planning tasks in MySQL". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.