title: Mysql insert query returns ERROR 1062 (23000): Duplicate entry '2147483647' for key 'PRIMARY'
body: <p>I've noticed an error during an insert query in my database.</p>
  
  <pre><code>mysql&gt; insert into users (name) values ('Gepp');
  </code></pre>
  
  <p>returned:</p>
  
  <blockquote>
    <p>ERROR 1062 (23000): Duplicate entry '2147483647' for key 'PRIMARY'</p>
  </blockquote>
  
  <p>It's the first time I get this error maybe this suggests that some kind of limit has been reached. Anyway I've checked in other posts complaining for the same error and found out that triggers may be the problem. Unfortunately it's not the case: </p>
  
  <pre><code>mysql&gt; SHOW triggers;
  Empty set (0.00 sec)
  </code></pre>
  
  <p><strong>EDIT</strong>
  The structure of my users table is shown below:</p>
  
  <pre><code>&gt; *************************** 1. row ***************************
    Field: uid
     Type: int(11)
     Null: NO
      Key: PRI
  Default: NULL
    Extra: auto_increment
  *************************** 2. row ***************************
    Field: name
     Type: varchar(50)
     Null: NO
      Key: 
  Default: NULL
    Extra: 
  *************************** 3. row ***************************
    Field: email
     Type: varchar(100)
     Null: NO
      Key: UNI
  Default: NULL
    Extra: 
  *************************** 4. row ***************************
    Field: encrypted_password
     Type: varchar(80)
     Null: NO
      Key: 
  Default: NULL
    Extra: 
  *************************** 5. row ***************************
    Field: salt
     Type: varchar(10)
     Null: NO
      Key: 
  Default: NULL
    Extra: 
  *************************** 6. row ***************************
    Field: descrizione
     Type: varchar(600)
     Null: YES
      Key: 
  Default: NULL
    Extra: 
  *************************** 7. row ***************************
    Field: motto
     Type: varchar(100)
     Null: NO
      Key: 
  Default: 
    Extra: 
  *************************** 8. row ***************************
    Field: status
     Type: varchar(100)
     Null: NO
      Key: 
  Default: Hey new gambler! Share your thoughts!
    Extra: 
  *************************** 9. row ***************************
    Field: game
     Type: varchar(100)
     Null: NO
      Key: 
  Default: 
    Extra: 
  *************************** 10. row ***************************
    Field: pokeroom
     Type: varchar(100)
     Null: NO
      Key: 
  Default: 
    Extra: 
  *************************** 11. row ***************************
    Field: score
     Type: int(11)
     Null: NO
      Key: 
  Default: 0
    Extra: 
  *************************** 12. row ***************************
    Field: created_at
     Type: datetime
     Null: YES
      Key: 
  Default: NULL
    Extra: 
  *************************** 13. row ***************************
    Field: updated_at
     Type: datetime
     Null: YES
      Key: 
  Default: NULL
    Extra: 
  *************************** 14. row ***************************
    Field: photo
     Type: varchar(500)
     Null: NO
      Key: 
  Default: 
    Extra: 
  *************************** 15. row ***************************
    Field: panorama
     Type: varchar(500)
     Null: NO
      Key: 
  Default: 
    Extra:
  </code></pre>
  
  <p>How can I solve this problem?</p>