Error 1062 – Duplicate entry ‘2147483647’ for key 1

CRE Loaded was giving me the error  1062 – Duplicate entry ‘2147483647’ for key 1 – when trying to add a new product.

Cause: for some unexplained reason the auto_increment ID field on Table “products” has gone up to 2147483647 which is apparently the maximum number of rows permitted in an INT column.


  1. Go to your phpMyadmin interface
  2. Backup your database (make sure you know how to restore it if needed)
  3. Browse the products table (select to sort the fields by Descending order)
  4. The top item should now have the ID = 2147483647
  5. Change the ID to a number up from the previous item (e.g.: Previous was ID = 301, than change the ID = 2147483647 to 302)
  6. Repeat same process with table “product_to_categories”
  7. Return to table “products”
  8. Select the SQL tab
  9. run the following SQL Query :  ALTER TABLE products AUTO_INCREMENT=303   (note that 303 is the next number up from the example on step 5, you should use the next number up in your situation)

It worked perfectly for me, hope this helps.

Technorati Tags: , , , ,

  1. Hi, i also have this problem when surfing ads, this “Duplicate entry ‘2147483647’ for key 1” just pump up and I can’t surf anymore ads because this always appears into the pages even in different browsers. Can you pls help me to fix this?tnx a lot!

  2. Thanks a lot! Really helped!!
    I’d almost lost a hope to repair it!.

  3. Excellent, thankyou for a nice clear answer that worked…I have another issue iof you have the time and inclination…check out the site and see the MASSIVE Transit parts sale and tell me why the top nav bar is running over into the page…

Leave a Comment

NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>