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;