Name

SHOW CREATE EVENT

Synopsis

SHOW CREATE EVENT event

This statement displays an SQL statement that can be used to create an event like the one given. It’s mostly useful for displaying any comments associated with the event because they’re not included in the results of the SHOW EVENTS statement.

Here is an example showing an event that was created with the CREATE EVENT statement earlier in this chapter:

SHOW CREATE EVENT students_copy \G

*************************** 1. row ***************************
       Event: students_copy
    sql_mode:
Create Event: CREATE EVENT `students_copy` ON SCHEDULE
EVERY 1 DAY ON COMPLETION PRESERVE ENABLE
COMMENT 'Daily copy of students table to students_backup'
DO CALL students_copy_proc()

Get MySQL in a Nutshell, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.