MySQL timed task

Source: Internet
Author: User

See if event is turned on

Open Event_scheduler

Set global Event_scheduler = 1;

Create a stored procedure Spark.test

CREATE PROCEDURE spark.test ()  BEGIN  Update spark.userbehaviordatasource Set v1 = 3 where page like ' page2% ';  END;  

Create Event Spark.e_test

Create event if not exists spark.e_test on  schedule every second on  completion Preserve  

Execute a stored procedure every minute spark.test

Close a transaction task

Alter event spark.e_test on completion PRESERVE DISABLE;  

Turn on transactional tasks

Alter event spark.e_test on completion PRESERVE ENABLE;  

Erase stored Procedure

drop procedure Spark.test;

Inserting data

Insert into Spark.userbehaviordatasource (page, v1, v2, V3) VALUES ("Page25", 1.6, 1.3, 1)

Data to be queried

Reference: http://blog.csdn.net/tjcyjd/article/details/11481459

MySQL timed task

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.