Skip to content

Instantly share code, notes, and snippets.

@ptrnov
Created February 24, 2016 03:31
Show Gist options
  • Select an option

  • Save ptrnov/b8b0b2145ed5e30b4de6 to your computer and use it in GitHub Desktop.

Select an option

Save ptrnov/b8b0b2145ed5e30b4de6 to your computer and use it in GitHub Desktop.
1. conf my.ini
event_scheduler = ON
2. run query procedure
BEGIN
#conf add mysql.ini
#--event-scheduler=ON
SET GLOBAL event_scheduler = OFF;
SET @@global.event_scheduler = OFF;
SET GLOBAL event_scheduler = 0;
SET @@global.event_scheduler = 0;
SET GLOBAL event_scheduler = ON;
SET @@global.event_scheduler = ON;
SET GLOBAL event_scheduler = 1;
SET @@global.event_scheduler = 1;
END
3. event
CREATE
EVENT
IF NOT EXISTS
my_simple_mysql_event
ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 10 MINUTE
ON COMPLETION NOT PRESERVE
DO
INSERT INTO
test_table
(id,event_name,createdtime)
VALUES
(null,'my_simple_mysql_event',CURRENT_TIMESTAMP)
;
4. check
show PROCESSLIST;
show events
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment