要查看当前是否已开启事件调度器SHOW VARIABLES LIKE ‘event_scheduler‘;开启事件查看器SET GLOBAL event_scheduler = 1;创建事件语法:CREATE EVENT [IF NOT EXISTS] event_nameON SCHEDULE schedule[ON COMPLETION [NOT] PRESERVE][ENABLE | DISABLE][COMMENT ‘comment‘]DO sql_statement;实例:CREATE EVENT updateInfoStatusON SCHEDULE EVERY 30 MINUTEDOUPDATE `jd_article` SET `status` = 0 WHERE `status` = 1 AND `date` <= now( );修改事件语法:ALTER EVENT event_name[ON SCHEDULE schedule][RENAME TO new_event_name][ON COMPLETION [NOT] PRESERVE][COMMENT ‘comment‘][ENABLE | DISABLE][DO sql_statement]实例:ALTER EVENT updateInfoStatusON SCHEDULE EVERY 30 MINUTEDOUPDATE `jd_article` SET `status` = 0 WHERE `status` = 1 AND `date` <= now( );删除事件DROP EVENTS IF EXISTS updateInfoStatus临时关闭事件ALTER EVENTS updateInfoStatus DISABLE开启事件ALTER EVENTS updateInfoStatus ENABLE查看事件详细信息SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE EVENT_NAME = ‘updateInfoStatus‘ AND EVENT_SCHEMA = ‘jdwc‘查看所有事件SHOW EVENTS查看事件创建信息SHOW CREATE EVENT updateInfoStatus