MySQL创建事件启动事件停止事件

1.配置定时任务event开启:

mysql> alter event EVENT_RegionTrafficIndex on completion preserve enable;

Query OK, 0 rows affected

2.配置定时任务event关闭:
mysql> alter event EVENT_RegionTrafficIndex on completion preserve disable;

Query OK, 0 rows affected


一般定时任务(event)查看sql:

查看Events:

1
2
3
4
mysql> show events\G 
mysql>  SELECT  FROM  mysql.event;
mysql>  SELECT  FROM  information_schema.events;

查看Events是否开启:

1
2
mysql>  select  @@event_scheduler;
mysql> show variables  like  'event_scheduler' ;

开启Events方法:

1
2
3
mysql>  set  GLOBAL  event_scheduler= ON ;
mysql>  set  GLOBAL  event_scheduler=1;



你可能感兴趣的:(MySQL创建事件启动事件停止事件)