title: MySql auto-increment not working while inserting multiple rows
body: <p>I am inserting multiple rows in the MySql database table the first row is getting inserted but for remaining it is showing the error:</p>
  
  <pre><code>[Error: ER_DUP_ENTRY: Duplicate entry '2' for key 'PRIMARY']
    code: 'ER_DUP_ENTRY',
    errno: 1062,
    sqlState: '23000',
    index: 1,
  </code></pre>
  
  <p>This is the structure of <code>id</code> field:</p>
  
  <p><a href="https://i.stack.imgur.com/6tD9z.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6tD9z.png" alt="enter image description here"></a></p>
  
  <p><strong>If I insert a single row the auto-increment works file.</strong></p>
  
  <p>I am not able to rectify the problem. Please help. Thanks.</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>I am using <a href="https://github.com/dresende/node-orm2" rel="nofollow noreferrer">node-rom2</a> and the code is</p>
  
  <pre><code>modelObj.create(arrayOfObjects, function (err, result) {
        if (err) {
           console.log("The error is :", err);
        }
        else {
           response.status = 'success';
           response.data = result;
        }
      next(response);
  });
  </code></pre>
  
  <p><strong>The SQL query is generated dynamically.</strong></p>