The usage of MYSQL event Altimeter
This article introduces the knowledge of "the use of MYSQL event altimeter". Many people will encounter such a dilemma in the operation of actual cases, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
To see if the event Scheduler is currently open
SHOW VARIABLES LIKE 'event_scheduler'
Www.2cto.com
Turn on the event altimeter
SET GLOBAL event_scheduler = 1
Create an event
Syntax:
CREATE EVENT [IF NOT EXISTS] event_name
ON SCHEDULE schedule
[ON COMPLETION [NOT] PRESERVE]
[ENABLE | DISABLE]
[COMMENT 'comment']
DO sql_statement
Example:
CREATE EVENT updateInfoStatus
ON SCHEDULE EVERY 30 MINUTE
DO
UPDATE `jd_ status` SET `status` = 0 WHERE `status` = 1 AND `date`