<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h4 class="title">
      <a name="show-create-event">
      </a>
      15.7.7.8 SHOW CREATE EVENT Statement
     </h4>
    </div>
   </div>
  </div>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting one-line language-sql"><div class="docs-select-all right" id="sa83061489"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-sql"><span class="token keyword">SHOW</span> <span class="token keyword">CREATE</span> <span class="token keyword">EVENT</span> <em class="replaceable">event_name</em></code></pre>
  </div>
  <p>
   This statement displays the
   <a class="link" href="create-event.html" title="15.1.13 CREATE EVENT Statement">
    <code class="literal">
     CREATE
        EVENT
    </code>
   </a>
   statement needed to re-create a given event. It
        requires the
   <a class="link" href="privileges-provided.html#priv_event">
    <code class="literal">
     EVENT
    </code>
   </a>
   privilege for
        the database from which the event is to be shown. For example
        (using the same event
   <code class="literal">
    e_daily
   </code>
   defined and
        then altered in
   <a class="xref" href="show-events.html" title="15.7.7.19 SHOW EVENTS Statement">
    Section 15.7.7.19, “SHOW EVENTS Statement”
   </a>
   ):
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa32082356"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-sql"><span class="token prompt">mysql&gt;</span> <span class="token keyword">SHOW</span> <span class="token keyword">CREATE</span> <span class="token keyword">EVENT</span> myschema<span class="token punctuation">.</span>e_daily\G
<span class="token output"><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span> 1. row <span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span>
               Event<span class="token punctuation">:</span> e_daily
            sql_mode<span class="token punctuation">:</span> ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,
                      NO_ZERO_IN_DATE,NO_ZERO_DATE,
                      ERROR_FOR_DIVISION_BY_ZERO,
                      NO_ENGINE_SUBSTITUTION
           time_zone<span class="token punctuation">:</span> SYSTEM
        Create Event<span class="token punctuation">:</span> CREATE DEFINER=`jon`@`ghidora` EVENT `e_daily`
                        ON SCHEDULE EVERY 1 DAY
                        STARTS CURRENT_TIMESTAMP + INTERVAL 6 HOUR
                        ON COMPLETION NOT PRESERVE
                        ENABLE
                        COMMENT 'Saves total number of sessions then
                                clears the table each day'
                        DO BEGIN
                          INSERT INTO site_activity.totals (time, total)
                            SELECT CURRENT_TIMESTAMP, COUNT(<span class="token punctuation">*</span>)
                              FROM site_activity.sessions;
                          DELETE FROM site_activity.sessions;
                        END
character_set_client<span class="token punctuation">:</span> utf8mb4
collation_connection<span class="token punctuation">:</span> utf8mb4_0900_ai_ci
  Database Collation<span class="token punctuation">:</span> utf8mb4_0900_ai_ci</span></code></pre>
  </div>
  <p>
   <code class="literal">
    character_set_client
   </code>
   is the session value of
        the
   <a class="link" href="server-system-variables.html#sysvar_character_set_client">
    <code class="literal">
     character_set_client
    </code>
   </a>
   system
        variable when the event was created.
   <code class="literal">
    collation_connection
   </code>
   is the session value of
        the
   <a class="link" href="server-system-variables.html#sysvar_collation_connection">
    <code class="literal">
     collation_connection
    </code>
   </a>
   system
        variable when the event was created.
   <code class="literal">
    Database
        Collation
   </code>
   is the collation of the database with which
        the event is associated.
  </p>
  <p>
   The output reflects the current status of the event
        (
   <code class="literal">
    ENABLE
   </code>
   ) rather than the status with which it
        was created.
  </p>
 </div>
 <br/>
</div>
