MySQL 提供了几种用于处理计划事件的 SQL 语句:MySQL provides several SQL statements for working with scheduled events:
新事件使用
CREATE EVENT语句来定义。请参阅 第 15.1.13 节,“CREATE EVENT 语句”。New events are defined using theCREATE EVENTstatement. See Section 15.1.13, “CREATE EVENT Statement”.现有事件的定义可以通过
ALTER EVENT语句来更改。请参阅 第 15.1.3 节,“ALTER EVENT 语句”。The definition of an existing event can be changed by means of theALTER EVENTstatement. See Section 15.1.3, “ALTER EVENT Statement”.当一个计划事件不再需要或不想保留时,其定义者可以使用
DROP EVENT语句将其从服务器中删除。请参阅 第 15.1.25 节,“DROP EVENT 语句”。事件是否在其计划结束后仍然存在,也取决于它的ON COMPLETION子句(如果有的话)。请参阅 第 15.1.13 节,“CREATE EVENT 语句”。When a scheduled event is no longer wanted or needed, it can be deleted from the server by its definer using theDROP EVENTstatement. See Section 15.1.25, “DROP EVENT Statement”. Whether an event persists past the end of its schedule also depends on itsON COMPLETIONclause, if it has one. See Section 15.1.13, “CREATE EVENT Statement”.任何具有在其上定义事件的数据库的
EVENT特权的用户都可以删除事件。参见 第 27.4.6 节,“事件调度器和 MySQL 特权”。An event can be dropped by any user having theEVENTprivilege for the database on which the event is defined. See Section 27.4.6, “The Event Scheduler and MySQL Privileges”.