ON SCHEDULE EVERY 7 WEEK STARTS
'2014-05-14 04:00:00'
ON COMPLETION PRESERVE
ENABLE
DO
[要执行的sql语句]
查看mysql事件状态是否开启mysql>show variables like 'event_scheduler'
+-----------------+-------+
| Variable_name | Value |
+-----------------+-------+
| event_scheduler | ON|
+-----------------+-------+
1 row in set (0.00 sec)
或
mysql>select @@event_scheduler
+-------------------+
| @@event_scheduler |
+-------------------+
| ON|
+-------------------+
1 row in set (0.00 sec)
*************************************************************
如果没有开启,开启它。
mysql>set global event_scheduler=on
Query OK, 0 rows affected (0.00 sec)
或
mysql>set global event_scheduler=1
Query OK, 0 rows affected (0.00 sec)
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)