MySQL Automatic execution events

Source: Internet
Author: User

#显示定时任务
SHOW EVENTS;
#查看是否开启定时器
SHOW VARIABLES like ' Event_scheduler ';
#开启定时器 (Admin user required)
SET GLOBAL event_scheduler = on;

#创建事件, 12-31 days a year 00:00:00 execution
The DROP event IF EXISTS "event name";
DELIMITER//
"Event name" of the CREATE event
On SCHEDULE Every 1 year starts ' 2017-12-31 00:00:00 '
Do call "functions, stored procedures, views"
//
DELIMITER;


#启动事件
ALTER event name "on completion PRESERVE ENABLE;

#关闭事件
#ALTER event name "on completion PRESERVE DISABLE;

Date interval (INTERVAL):

Quantity {Year| QUARTER | MONTH | Day | HOUR |  MINUTE | WEEK | SECOND | Year_month | Day_hour |  Day_minute |  Day_second | Hour_minute | Hour_second | Minute_second}

MySQL Automatic execution events

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.