Last active
December 29, 2015 19:29
-
-
Save anytizer/7717387 to your computer and use it in GitHub Desktop.
Events in MySQL (works like cron feature in Linux server)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE `_dt` ( | |
`dt` DATETIME DEFAULT NULL | |
); | |
DROP EVENT IF EXISTS e_minutely; | |
DELIMITER $$ | |
CREATE EVENT e_minutely | |
ON SCHEDULE | |
EVERY 1 MINUTE | |
COMMENT 'Test the events.' | |
DO BEGIN | |
INSERT INTO _dt(dt) VALUES (NOW()); | |
END $$ | |
SET GLOBAL event_scheduler = ON; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment