如何查看mysql event是否启用

  • 2019 年 12 月 10 日
  • 筆記

查看事件是否开启

MySQL [(none)]> show variables like 'event_scheduler';  +-----------------+-------+  | Variable_name   | Value |  +-----------------+-------+  | event_scheduler | OFF   |  +-----------------+-------+  1 row in set (0.02 sec)

开启事件

MySQL [(none)]> set global event_scheduler=on; //开启event需要root(SUPER privilege(s))  Query OK, 0 rows affected (0.05 sec)  MySQL [(none)]> show variables like 'event_scheduler';  +-----------------+-------+  | Variable_name   | Value |  +-----------------+-------+  | event_scheduler | ON    |  +-----------------+-------+  1 row in set (0.00 sec)