Scheduled MySQL task

Source: Internet
Author: User
Drop event if exists eve1; delimiter $ create event eve1 on schedule every 1 second starts now () ends now () + 1on completion preservedisabledobeginupdate testtable1 set age = age + 1 where id = 1; end $ delimiter; select * From testtable1; select now (); /* standard creation statement eventseventscreate event Task Name on schedule at timestamp/any non-empty integer time unit of every [Starts timestamp] [Ends timestamp] [on completion [not] preserve] [enable | disable] [comment' Inter-task comment '] the SQL statement endon schedule to be executed by dobegin has two ways to set the scheduled task: At timestamp: any non-empty integer time unit of a scheduled task every [Starts timestamp] [Ends timestamp]: the [Starts timestamp] [Ends timestamp] is set for repeated scheduled tasks, which indicates that the timestamp and datetime data types can be repeated only during this time period. It is required to provide the future time (greater than current_timestamp) and the last time earlier than the Unix time (equal to or less than '2017-12-31 23:59:59 '). The unit of time is key words: year, month, day, hour, minute or second. Note: Other time units are also valid, such as quarter, week, year_month, day_hour, day_minute, day_second, hour_minute, hour_second, and minute_second, but they are non-standard, non-practical, and not. [On completion [not] preserve]: If this parameter is left blank, the default value is on completion not preserve, indicating that this event will not happen again, that is, when a scheduled task is completed, or when the repetitive scheduled task is executed to the ends stage, the task is dropped. On completion preserve if the event task is not dropped after the task is completed, the prompt is: you do not need to try this statement. [Enable | disable] if it is set to enable by default, the system starts the event. If it is set to enable, the system starts the event. If disable is not started, you can use the modify command to enable or disable the event, to modify an event task, replace the keyword "CREATE" with "alter. */
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.