<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h3 class="title">
      <a name="example-auto-increment">
      </a>
      5.6.9 Using AUTO_INCREMENT
     </h3>
    </div>
   </div>
  </div>
  <a class="indexterm" name="idm46045324592208">
  </a>
  <a class="indexterm" name="idm46045324591136">
  </a>
  <a class="indexterm" name="idm46045324590064">
  </a>
  <p>
   The
   <code class="literal">
    AUTO_INCREMENT
   </code>
   attribute can be used to
        generate a unique identity for new rows:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa89455029"><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">CREATE</span> <span class="token keyword">TABLE</span> animals <span class="token punctuation">(</span>
     id <span class="token datatype">MEDIUMINT</span> <span class="token operator">NOT</span> <span class="token boolean">NULL</span> <span class="token keyword">AUTO_INCREMENT</span><span class="token punctuation">,</span>
     <span class="token keyword">name</span> <span class="token datatype">CHAR</span><span class="token punctuation">(</span><span class="token number">30</span><span class="token punctuation">)</span> <span class="token operator">NOT</span> <span class="token boolean">NULL</span><span class="token punctuation">,</span>
     <span class="token keyword">PRIMARY</span> <span class="token keyword">KEY</span> <span class="token punctuation">(</span>id<span class="token punctuation">)</span>
<span class="token punctuation">)</span><span class="token punctuation">;</span>

<span class="token keyword">INSERT</span> <span class="token keyword">INTO</span> animals <span class="token punctuation">(</span><span class="token keyword">name</span><span class="token punctuation">)</span> <span class="token keyword">VALUES</span>
    <span class="token punctuation">(</span><span class="token string">'dog'</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token punctuation">(</span><span class="token string">'cat'</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token punctuation">(</span><span class="token string">'penguin'</span><span class="token punctuation">)</span><span class="token punctuation">,</span>
    <span class="token punctuation">(</span><span class="token string">'lax'</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token punctuation">(</span><span class="token string">'whale'</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token punctuation">(</span><span class="token string">'ostrich'</span><span class="token punctuation">)</span><span class="token punctuation">;</span>

<span class="token keyword">SELECT</span> <span class="token operator">*</span> <span class="token keyword">FROM</span> animals<span class="token punctuation">;</span></code></pre>
  </div>
  <p>
   Which returns:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting language-none"><div class="docs-select-all right" id="sa2699765"><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-none">+----+---------+
| id | name    |
+----+---------+
|  1 | dog     |
|  2 | cat     |
|  3 | penguin |
|  4 | lax     |
|  5 | whale   |
|  6 | ostrich |
+----+---------+</code></pre>
  </div>
  <p>
   No value was specified for the
   <code class="literal">
    AUTO_INCREMENT
   </code>
   column, so MySQL assigned sequence numbers automatically. You
        can also explicitly assign 0 to the column to generate sequence
        numbers, unless the
   <a class="link" href="sql-mode.html#sqlmode_no_auto_value_on_zero">
    <code class="literal">
     NO_AUTO_VALUE_ON_ZERO
    </code>
   </a>
   SQL mode
        is enabled. For example:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting one-line language-sql"><div class="docs-select-all right" id="sa22351037"><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">INSERT</span> <span class="token keyword">INTO</span> animals <span class="token punctuation">(</span>id<span class="token punctuation">,</span><span class="token keyword">name</span><span class="token punctuation">)</span> <span class="token keyword">VALUES</span><span class="token punctuation">(</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token string">'groundhog'</span><span class="token punctuation">)</span><span class="token punctuation">;</span></code></pre>
  </div>
  <p>
   If the column is declared
   <code class="literal">
    NOT NULL
   </code>
   , it is
        also possible to assign
   <code class="literal">
    NULL
   </code>
   to the column to
        generate sequence numbers. For example:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting one-line language-sql"><div class="docs-select-all right" id="sa76458133"><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">INSERT</span> <span class="token keyword">INTO</span> animals <span class="token punctuation">(</span>id<span class="token punctuation">,</span><span class="token keyword">name</span><span class="token punctuation">)</span> <span class="token keyword">VALUES</span><span class="token punctuation">(</span><span class="token boolean">NULL</span><span class="token punctuation">,</span><span class="token string">'squirrel'</span><span class="token punctuation">)</span><span class="token punctuation">;</span></code></pre>
  </div>
  <p>
   When you insert any other value into an
   <code class="literal">
    AUTO_INCREMENT
   </code>
   column, the column is set to
        that value and the sequence is reset so that the next
        automatically generated value follows sequentially from the
        largest column value. For example:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa87424710"><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">INSERT</span> <span class="token keyword">INTO</span> animals <span class="token punctuation">(</span>id<span class="token punctuation">,</span><span class="token keyword">name</span><span class="token punctuation">)</span> <span class="token keyword">VALUES</span><span class="token punctuation">(</span><span class="token number">100</span><span class="token punctuation">,</span><span class="token string">'rabbit'</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token keyword">INSERT</span> <span class="token keyword">INTO</span> animals <span class="token punctuation">(</span>id<span class="token punctuation">,</span><span class="token keyword">name</span><span class="token punctuation">)</span> <span class="token keyword">VALUES</span><span class="token punctuation">(</span><span class="token boolean">NULL</span><span class="token punctuation">,</span><span class="token string">'mouse'</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token keyword">SELECT</span> <span class="token operator">*</span> <span class="token keyword">FROM</span> animals<span class="token punctuation">;</span>
<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>
<span class="token output"><span class="token punctuation">|</span> id  <span class="token punctuation">|</span> name      <span class="token punctuation">|</span></span>
<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>
<span class="token output"><span class="token punctuation">|</span>   1 <span class="token punctuation">|</span> dog       <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span>   2 <span class="token punctuation">|</span> cat       <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span>   3 <span class="token punctuation">|</span> penguin   <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span>   4 <span class="token punctuation">|</span> lax       <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span>   5 <span class="token punctuation">|</span> whale     <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span>   6 <span class="token punctuation">|</span> ostrich   <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span>   7 <span class="token punctuation">|</span> groundhog <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span>   8 <span class="token punctuation">|</span> squirrel  <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> 100 <span class="token punctuation">|</span> rabbit    <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> 101 <span class="token punctuation">|</span> mouse     <span class="token punctuation">|</span></span>
<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></code></pre>
  </div>
  <p>
   Updating an existing
   <code class="literal">
    AUTO_INCREMENT
   </code>
   column
        value also resets the
   <code class="literal">
    AUTO_INCREMENT
   </code>
   sequence.
  </p>
  <p>
   You can retrieve the most recent automatically generated
   <code class="literal">
    AUTO_INCREMENT
   </code>
   value with the
   <a class="link" href="information-functions.html#function_last-insert-id">
    <code class="literal">
     LAST_INSERT_ID()
    </code>
   </a>
   SQL function or
        the
   <a class="ulink" href="/doc/c-api/8.4/en/mysql-insert-id.html" target="_top">
    <code class="literal">
     mysql_insert_id()
    </code>
   </a>
   C API
        function. These functions are connection-specific, so their
        return values are not affected by another connection which is
        also performing inserts.
  </p>
  <p>
   Use the smallest integer data type for the
   <code class="literal">
    AUTO_INCREMENT
   </code>
   column that is large enough to
        hold the maximum sequence value you require. When the column
        reaches the upper limit of the data type, the next attempt to
        generate a sequence number fails. Use the
   <code class="literal">
    UNSIGNED
   </code>
   attribute if possible to allow a
        greater range. For example, if you use
   <a class="link" href="integer-types.html" title="13.1.2 Integer Types (Exact Value) - INTEGER, INT, SMALLINT, TINYINT, MEDIUMINT, BIGINT">
    <code class="literal">
     TINYINT
    </code>
   </a>
   , the maximum permissible
        sequence number is 127. For
   <a class="link" href="integer-types.html" title="13.1.2 Integer Types (Exact Value) - INTEGER, INT, SMALLINT, TINYINT, MEDIUMINT, BIGINT">
    <code class="literal">
     TINYINT
        UNSIGNED
    </code>
   </a>
   , the maximum is 255. See
   <a class="xref" href="integer-types.html" title="13.1.2 Integer Types (Exact Value) - INTEGER, INT, SMALLINT, TINYINT, MEDIUMINT, BIGINT">
    Section 13.1.2, “Integer Types (Exact Value) - INTEGER, INT, SMALLINT, TINYINT,
        MEDIUMINT, BIGINT”
   </a>
   for the ranges of all the
        integer types.
  </p>
  <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
   <div class="admon-title">
    Note
   </div>
   <p>
    For a multiple-row insert,
    <a class="link" href="information-functions.html#function_last-insert-id">
     <code class="literal">
      LAST_INSERT_ID()
     </code>
    </a>
    and
    <a class="ulink" href="/doc/c-api/8.4/en/mysql-insert-id.html" target="_top">
     <code class="literal">
      mysql_insert_id()
     </code>
    </a>
    actually
          return the
    <code class="literal">
     AUTO_INCREMENT
    </code>
    key from the
    <span class="emphasis">
     <em>
      first
     </em>
    </span>
    of the inserted rows. This enables
          multiple-row inserts to be reproduced correctly on other
          servers in a replication setup.
   </p>
  </div>
  <p>
   To start with an
   <code class="literal">
    AUTO_INCREMENT
   </code>
   value other
        than 1, set that value with
   <a class="link" href="create-table.html" title="15.1.20 CREATE TABLE Statement">
    <code class="literal">
     CREATE
        TABLE
    </code>
   </a>
   or
   <a class="link" href="alter-table.html" title="15.1.9 ALTER TABLE Statement">
    <code class="literal">
     ALTER TABLE
    </code>
   </a>
   ,
        like this:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting one-line language-sql"><div class="docs-select-all right" id="sa48544495"><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">ALTER</span> <span class="token keyword">TABLE</span> tbl <span class="token keyword">AUTO_INCREMENT</span> <span class="token operator">=</span> <span class="token number">100</span><span class="token punctuation">;</span></code></pre>
  </div>
  <div class="simplesect">
   <div class="titlepage">
    <div>
     <div class="simple">
      <h4 class="title">
       <a name="example-auto-increment-innodb-notes">
       </a>
       InnoDB Notes
      </h4>
     </div>
    </div>
   </div>
   <p>
    For information about
    <code class="literal">
     AUTO_INCREMENT
    </code>
    usage
          specific to
    <code class="literal">
     InnoDB
    </code>
    , see
    <a class="xref" href="innodb-auto-increment-handling.html" title="17.6.1.6 AUTO_INCREMENT Handling in InnoDB">
     Section 17.6.1.6, “AUTO_INCREMENT Handling in InnoDB”
    </a>
    .
   </p>
  </div>
  <div class="simplesect">
   <div class="titlepage">
    <div>
     <div class="simple">
      <h4 class="title">
       <a name="example-auto-increment-myisam-notes">
       </a>
       MyISAM Notes
      </h4>
     </div>
    </div>
   </div>
   <div class="itemizedlist">
    <ul class="itemizedlist" style="list-style-type: disc; ">
     <li class="listitem">
      <p>
       For
       <code class="literal">
        MyISAM
       </code>
       tables, you can specify
       <code class="literal">
        AUTO_INCREMENT
       </code>
       on a secondary column in
              a multiple-column index. In this case, the generated value
              for the
       <code class="literal">
        AUTO_INCREMENT
       </code>
       column is
              calculated as
       <a class="link" href="aggregate-functions.html#function_max">
        <code class="literal">
         MAX(
         <em class="replaceable">
          <code>
           auto_increment_column
          </code>
         </em>
         )
              + 1 WHERE
              prefix=
         <em class="replaceable">
          <code>
           given-prefix
          </code>
         </em>
        </code>
       </a>
       .
              This is useful when you want to put data into ordered
              groups.
      </p>
      <div class="copytoclipboard-wrapper">
       <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa81353980"><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">CREATE</span> <span class="token keyword">TABLE</span> animals <span class="token punctuation">(</span>
    grp <span class="token datatype">ENUM</span><span class="token punctuation">(</span><span class="token string">'fish'</span><span class="token punctuation">,</span><span class="token string">'mammal'</span><span class="token punctuation">,</span><span class="token string">'bird'</span><span class="token punctuation">)</span> <span class="token operator">NOT</span> <span class="token boolean">NULL</span><span class="token punctuation">,</span>
    id <span class="token datatype">MEDIUMINT</span> <span class="token operator">NOT</span> <span class="token boolean">NULL</span> <span class="token keyword">AUTO_INCREMENT</span><span class="token punctuation">,</span>
    <span class="token keyword">name</span> <span class="token datatype">CHAR</span><span class="token punctuation">(</span><span class="token number">30</span><span class="token punctuation">)</span> <span class="token operator">NOT</span> <span class="token boolean">NULL</span><span class="token punctuation">,</span>
    <span class="token keyword">PRIMARY</span> <span class="token keyword">KEY</span> <span class="token punctuation">(</span>grp<span class="token punctuation">,</span>id<span class="token punctuation">)</span>
<span class="token punctuation">)</span> <span class="token keyword">ENGINE</span><span class="token operator">=</span>MyISAM<span class="token punctuation">;</span>

<span class="token keyword">INSERT</span> <span class="token keyword">INTO</span> animals <span class="token punctuation">(</span>grp<span class="token punctuation">,</span><span class="token keyword">name</span><span class="token punctuation">)</span> <span class="token keyword">VALUES</span>
    <span class="token punctuation">(</span><span class="token string">'mammal'</span><span class="token punctuation">,</span><span class="token string">'dog'</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token punctuation">(</span><span class="token string">'mammal'</span><span class="token punctuation">,</span><span class="token string">'cat'</span><span class="token punctuation">)</span><span class="token punctuation">,</span>
    <span class="token punctuation">(</span><span class="token string">'bird'</span><span class="token punctuation">,</span><span class="token string">'penguin'</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token punctuation">(</span><span class="token string">'fish'</span><span class="token punctuation">,</span><span class="token string">'lax'</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token punctuation">(</span><span class="token string">'mammal'</span><span class="token punctuation">,</span><span class="token string">'whale'</span><span class="token punctuation">)</span><span class="token punctuation">,</span>
    <span class="token punctuation">(</span><span class="token string">'bird'</span><span class="token punctuation">,</span><span class="token string">'ostrich'</span><span class="token punctuation">)</span><span class="token punctuation">;</span>

<span class="token keyword">SELECT</span> <span class="token operator">*</span> <span class="token keyword">FROM</span> animals <span class="token keyword">ORDER</span> <span class="token keyword">BY</span> grp<span class="token punctuation">,</span>id<span class="token punctuation">;</span></code></pre>
      </div>
      <p>
       Which returns:
      </p>
      <div class="copytoclipboard-wrapper">
       <pre class="programlisting language-none"><div class="docs-select-all right" id="sa83059400"><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-none">+--------+----+---------+
| grp    | id | name    |
+--------+----+---------+
| fish   |  1 | lax     |
| mammal |  1 | dog     |
| mammal |  2 | cat     |
| mammal |  3 | whale   |
| bird   |  1 | penguin |
| bird   |  2 | ostrich |
+--------+----+---------+</code></pre>
      </div>
      <p>
       In this case (when the
       <code class="literal">
        AUTO_INCREMENT
       </code>
       column is part of a multiple-column index),
       <code class="literal">
        AUTO_INCREMENT
       </code>
       values are reused if you
              delete the row with the biggest
       <code class="literal">
        AUTO_INCREMENT
       </code>
       value in any group. This
              happens even for
       <code class="literal">
        MyISAM
       </code>
       tables, for
              which
       <code class="literal">
        AUTO_INCREMENT
       </code>
       values normally
              are not reused.
      </p>
     </li>
     <li class="listitem">
      <p>
       If the
       <code class="literal">
        AUTO_INCREMENT
       </code>
       column is part of
              multiple indexes, MySQL generates sequence values using
              the index that begins with the
       <code class="literal">
        AUTO_INCREMENT
       </code>
       column, if there is one.
              For example, if the
       <code class="literal">
        animals
       </code>
       table
              contained indexes
       <code class="literal">
        PRIMARY KEY (grp, id)
       </code>
       and
       <code class="literal">
        INDEX (id)
       </code>
       , MySQL would ignore the
       <code class="literal">
        PRIMARY KEY
       </code>
       for generating sequence
              values. As a result, the table would contain a single
              sequence, not a sequence per
       <code class="literal">
        grp
       </code>
       value.
      </p>
     </li>
    </ul>
   </div>
  </div>
  <div class="simplesect">
   <div class="titlepage">
    <div>
     <div class="simple">
      <h4 class="title">
       <a name="example-auto-increment-further-reading">
       </a>
       Further Reading
      </h4>
     </div>
    </div>
   </div>
   <p>
    More information about
    <code class="literal">
     AUTO_INCREMENT
    </code>
    is
          available here:
   </p>
   <div class="itemizedlist">
    <ul class="itemizedlist" style="list-style-type: disc; ">
     <li class="listitem">
      <p>
       How to assign the
       <code class="literal">
        AUTO_INCREMENT
       </code>
       attribute to a column:
       <a class="xref" href="create-table.html" title="15.1.20 CREATE TABLE Statement">
        Section 15.1.20, “CREATE TABLE Statement”
       </a>
       , and
       <a class="xref" href="alter-table.html" title="15.1.9 ALTER TABLE Statement">
        Section 15.1.9, “ALTER TABLE Statement”
       </a>
       .
      </p>
     </li>
     <li class="listitem">
      <p>
       How
       <code class="literal">
        AUTO_INCREMENT
       </code>
       behaves depending on
              the
       <a class="link" href="sql-mode.html#sqlmode_no_auto_value_on_zero">
        <code class="literal">
         NO_AUTO_VALUE_ON_ZERO
        </code>
       </a>
       SQL mode:
       <a class="xref" href="sql-mode.html" title="7.1.11 Server SQL Modes">
        Section 7.1.11, “Server SQL Modes”
       </a>
       .
      </p>
     </li>
     <li class="listitem">
      <p>
       How to use the
       <a class="link" href="information-functions.html#function_last-insert-id">
        <code class="literal">
         LAST_INSERT_ID()
        </code>
       </a>
       function
              to find the row that contains the most recent
       <code class="literal">
        AUTO_INCREMENT
       </code>
       value:
       <a class="xref" href="information-functions.html" title="14.15 Information Functions">
        Section 14.15, “Information Functions”
       </a>
       .
      </p>
     </li>
     <li class="listitem">
      <p>
       Setting the
       <code class="literal">
        AUTO_INCREMENT
       </code>
       value to be
              used:
       <a class="xref" href="server-system-variables.html" title="7.1.8 Server System Variables">
        Section 7.1.8, “Server System Variables”
       </a>
       .
      </p>
     </li>
     <li class="listitem">
      <p>
       <a class="xref" href="innodb-auto-increment-handling.html" title="17.6.1.6 AUTO_INCREMENT Handling in InnoDB">
        Section 17.6.1.6, “AUTO_INCREMENT Handling in InnoDB”
       </a>
      </p>
     </li>
     <li class="listitem">
      <p>
       <code class="literal">
        AUTO_INCREMENT
       </code>
       and replication:
       <a class="xref" href="replication-features-auto-increment.html" title="19.5.1.1 Replication and AUTO_INCREMENT">
        Section 19.5.1.1, “Replication and AUTO_INCREMENT”
       </a>
       .
      </p>
     </li>
     <li class="listitem">
      <p>
       Server-system variables related to
       <code class="literal">
        AUTO_INCREMENT
       </code>
       (
       <a class="link" href="replication-options-source.html#sysvar_auto_increment_increment">
        <code class="literal">
         auto_increment_increment
        </code>
       </a>
       and
       <a class="link" href="replication-options-source.html#sysvar_auto_increment_offset">
        <code class="literal">
         auto_increment_offset
        </code>
       </a>
       )
              that can be used for replication:
       <a class="xref" href="server-system-variables.html" title="7.1.8 Server System Variables">
        Section 7.1.8, “Server System Variables”
       </a>
       .
      </p>
     </li>
    </ul>
   </div>
  </div>
 </div>
 <br/>
</div>
