Database Reference
In-Depth Information
Next, we look for a variable named event_scheduler . If this variable is set to OFF ,
we need to ask the system administrator (or someone with the SUPER privilege) to
execute the following statement:
SET GLOBAL event_scheduler = ON;
Granting EVENT permission
Every user who wants to create or drop an event needs the EVENT privilege, either
globally, or on the database on which he/she plans to add the event. Please refer to
Chapter 18 for details about granting such privileges.
Creating an event
The current 3.1.x phpMyAdmin version does not have a web interface on which
we could choose the various parts of the CREATE EVENT statement. Therefore, the
only method left is to use the SQL query box to enter the statement and to know its
syntax! Here, we'll use a totally fictitious example:
CREATE EVENT add_page_count
ON SCHEDULE
EVERY 1 MINUTE
DO
UPDATE author set total_page_count = total_page_count + 1 WHERE
id = 1;
You can now get some amusement by browsing the author table once in a while,
and see the counter incrementing for author 1.
Event manipulation
Events are related to one database, which is why you see an Events slider on the
Structure page for the marc_book database. Activating it reveals this panel:
Indeed, this is a recurring event. We can use the first icon to edit the event (which
will have the effect of deleting and recreating the event), and the X icon to remove it.
 
Search WWH ::




Custom Search