Computer >> Computer tutorials >  >> Programming >> MySQL

How can we ENABLE AND DISABLE a particular MySQL event?


With the help of ALTER EVENT statement along with the ENABLE and DISABLE keyword, we can ENABLE and DISABLE the event. To illustrate it we are having the following example −

Example

mysql> ALTER EVENT hello DISABLE;
Query OK, 0 rows affected (0.00 sec)

The above query will DISABLE the event named ‘Hello’ and the query below will enable it.

mysql> ALTER EVENT hello ENABLE;
Query OK, 0 rows affected (0.00 sec)