title: How to know what would be the next auto increment id in mysql?
body: <p>Suppose I have a table like this:</p>
  
  <pre><code>----Id-------Data---
  |   1   |   Data1   |
  --------------------
  |   2   |   Data2   |
  --------------------
  |   3   |   Data3   |
  --------------------
  </code></pre>
  
  <p>If I run this query</p>
  
  <blockquote>
    <p>SELECT MAX(id) FROM table</p>
  </blockquote>
  
  <p>it will show the result <strong>3</strong> and if i increment it with <strong>1</strong> generally this will be the next auto incremented id.</p>
  
  <p>If i delete the record <strong>where id is 3</strong> and after that when i run this query again mean</p>
  
  <blockquote>
    <p>SELECT MAX(id) FROM table</p>
  </blockquote>
  
  <p>it will show <strong>2</strong>, and if i increment it with <strong>1</strong> then it will be <strong>3</strong>. Now if i insert a new record the auto increment id will be <strong>4</strong>.</p>
  
  <p>Now my question is how know what would be the next exact auto increment id?</p>