Using Views An event is not migrated or dropped as a result of renaming or dropping the user who created it. Suppose that the user  jon@ghidora  has been granted the  EVENT  and  INSERT  privileges on the myschema  schema. This user then creates the following event: After this event has been created,  root  revokes the  EVENT  privilege for  jon@ghidora . However, e_insert  continues to execute, inserting a new row into  mytable  each seven seconds. The same would be true if  root  had issued either of these statements: You can verify that this is true by examining the  INFORMATION_SCHEMA.EVENTS  table (see Section 26.3.14, “The INFORMATION_SCHEMA EVENTS Table” ) before and after issuing a  DROP USER or  RENAME USER  statement. Event definitions are stored in the data dictionary. To drop an event created by another user account, you must be the MySQL  root  user or another user with the necessary privileges. Users’  EVENT  privileges are stored in the  Event_priv  columns of the  mysql.user  and mysql.db  tables. In both cases, this column holds one of the values ’ Y ’ or ’ N ’. ’ N ’ is the default. mysql.user.Event_priv  is set to ’ Y ’ for a given user only if that user has the global  EVENT  privilege (that is, if the privilege was bestowed using  GRANT EVENT ON *.* ). For a schema-level  EVENT  privilege, GRANT  creates a row in  mysql.db  and sets that row’s  Db  column to the name of the schema, the  User column to the name of the user, and the  Event_priv  column to ’ Y ’. There should never be any need to manipulate these tables directly, since the  GRANT EVENT  and  REVOKE EVENT  statements perform the required operations on them. Five status variables provide counts of event-related operations (but  not  of statements executed by events; see Section 25.8, “Restrictions on Stored Programs” ). These are: You can view current values for all of these at one time by running the statement  SHOW STATUS LIKE ’%event%’; . MySQL supports views, including updatable views. Views are stored queries that when invoked produce a result set. A view acts as a virtual table. 25.5 Using Views CREATE EVENT e_insert ON SCHEDULE EVERY 7 SECOND DO INSERT INTO myschema.mytable; • DROP USER jon@ghidora; • RENAME USER jon@ghidora TO someotherguy@ghidora; • Com_create_event : The number of  CREATE EVENT  statements executed since the last server restart. • Com_alter_event : The number of  ALTER EVENT  statements executed since the last server restart. • Com_drop_event : The number of  DROP EVENT  statements executed since the last server restart. • Com_show_create_event : The number of  SHOW CREATE EVENT  statements executed since the last server restart. • Com_show_events : The number of  SHOW EVENTS  statements executed since the last server restart. 4744