<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h4 class="title">
      <a name="mysqldump-definition-data-dumps">
      </a>
      9.4.5.4 Dumping Table Definitions and Content Separately
     </h4>
    </div>
   </div>
  </div>
  <p>
   The
   <a class="link" href="mysqldump.html#option_mysqldump_no-data">
    <code class="option">
     --no-data
    </code>
   </a>
   option tells
   <a class="link" href="mysqldump.html" title="6.5.4 mysqldump — A Database Backup Program">
    <span class="command">
     <strong>
      mysqldump
     </strong>
    </span>
   </a>
   not to dump table data, resulting
          in the dump file containing only statements to create the
          tables. Conversely, the
   <a class="link" href="mysqldump.html#option_mysqldump_no-create-info">
    <code class="option">
     --no-create-info
    </code>
   </a>
   option
          tells
   <a class="link" href="mysqldump.html" title="6.5.4 mysqldump — A Database Backup Program">
    <span class="command">
     <strong>
      mysqldump
     </strong>
    </span>
   </a>
   to suppress
   <code class="literal">
    CREATE
   </code>
   statements from the output, so that
          the dump file contains only table data.
  </p>
  <p>
   For example, to dump table definitions and data separately for
          the
   <code class="literal">
    test
   </code>
   database, use these commands:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting language-terminal"><div class="docs-select-all right" id="sa53019080"><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-terminal"><span class="token prompt">$&gt; </span><span class="token command">mysqldump</span> <span class="token property">--no-data</span> test &gt; dump-defs<span class="token punctuation">.</span>sql
<span class="token prompt">$&gt; </span><span class="token command">mysqldump</span> <span class="token property">--no-create-info</span> test &gt; dump-data<span class="token punctuation">.</span>sql</code></pre>
  </div>
  <p>
   For a definition-only dump, add the
   <a class="link" href="mysqldump.html#option_mysqldump_routines">
    <code class="option">
     --routines
    </code>
   </a>
   and
   <a class="link" href="mysqldump.html#option_mysqldump_events">
    <code class="option">
     --events
    </code>
   </a>
   options to also include stored routine and event definitions:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa20987304"><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-terminal"><span class="token prompt">$&gt; </span><span class="token command">mysqldump</span> <span class="token property">--no-data</span> <span class="token property">--routines</span> <span class="token property">--events</span> test &gt; dump-defs<span class="token punctuation">.</span>sql</code></pre>
  </div>
 </div>
 <br/>
</div>
