mysql每月执行一次,Event Scheduler应该每月执行一次

I have Win XP os and XAMPP installed in my machine.

I need to execute my event/scheduler at 12:00:00 AM of First day of every month.

Means 1st of every month. (e.g. jan 1st, Feb1 1st, March 1st, ... ).

And

I also need to call the stored procedure in the same event.

And I want achieve all this using Event/Job only not from front end.

Please spend few minutes for my query.

解决方案

The MySQL event syntax is very simple -

DELIMITER $$

CREATE EVENT event1

ON SCHEDULE EVERY '1' MONTH

STARTS '2011-05-01 00:00:00'

DO

BEGIN

-- your code

END$$

DELIMITER ;

Event will start working on '2011-05-01' at '00:00:00' (datetime must be in a future).

Do not forget to enable global event scheduling thread -

SET GLOBAL event_scheduler = 1;

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值