Page 1 of 1
Duplicate Entry Error while copying or trying to add new pro
Posted: Wed Sep 21, 2011 9:07 am
by CanadaPleco
I have never run into this error before, until today. I moved my site to a live URL, modified the config file and changed the settings in the admin to reflect the new domain. Everything else seems to be working find except I cannot add a new product. Every way I try I get the following error:
Code: Select all
Error: Duplicate entry '0-0' for key 1
Error No: 1062
INSERT INTO product_to_store SET product_id = '0', store_id = '0'
Re: Duplicate Entry Error while copying or trying to add new
Posted: Fri Sep 23, 2011 5:10 am
by CanadaPleco
No ideas?
This only is happening for adding new products or updating them. No other part of the admin. I've uploaded the original files and still nothing (even tho I have not changed any admin files) other then config to the appropriate settings.
Re: Duplicate Entry Error while copying or trying to add new
Posted: Fri Sep 23, 2011 5:14 am
by uksitebuilder
product_id = 0 just doesn't seem right
have you modified the admin/model/catalog/product.php ?
Re: Duplicate Entry Error while copying or trying to add new
Posted: Sat Sep 24, 2011 2:43 am
by CanadaPleco
I didn't think I did, I re-uploaded that file and am now getting this error on copying a product.
Code: Select all
Error: Duplicate entry '602-1' for key 1
Error No: 1062
INSERT INTO product_description SET product_id = '602', language_id = '1', name = 'A Hairy List Notepad', meta_keyword = '', meta_description = '', description = '<p>\r\n Need to leave a "moosage" in your neck of the woods? Our new magnetic notepads will keep your family posted! Each pad is backed with a strong magnetic strip and comes with 50 sheets of easy-to-tear paper featuring popular Lazy One designs! pads are shrink wrapped with a hook attached. Size: Each sheet is 11" x 4.25"</p>\r\n'
Inserting a new product
Code: Select all
Error: Duplicate entry '603-1' for key 1
Error No: 1062
INSERT INTO product_description SET product_id = '603', language_id = '1', name = 'ab', meta_keyword = '', meta_description = '', description = ''
Re: Duplicate Entry Error while copying or trying to add new
Posted: Sat Sep 24, 2011 2:59 am
by CanadaPleco
Went thru and cleaned up the DB manually in phpmyadmin and its working... what a pain.
Re: Duplicate Entry Error while copying or trying to add new
Posted: Sat Feb 09, 2013 3:31 pm
by reyan123
i got the following error while adding product into my website
Notice: Error: Duplicate entry '346-0' for key 1
Error No: 1062
INSERT INTO product_to_store SET product_id = '346', store_id = '0' in /home/fundaina/public_html/system/database/mysql.php on line 49
help me to solve this issue .
Re: Duplicate Entry Error while copying or trying to add new
Posted: Sat Feb 09, 2013 4:07 pm
by reyan123
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.
Fix:
Go to your phpMyadmin interface
Backup your database (make sure you know how to restore it if needed)
Browse the products table (select to sort the fields by Descending order)
The top item should now have the ID = 2147483647
Change the ID to a number up from the previous item (e.g.: Previous was ID = 301, than change the ID = 2147483647 to 302)
Repeat same process with table “product_to_categories”
Return to table “products”
Select the SQL tab
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.
Re: Duplicate Entry Error while copying or trying to add new pro
Posted: Fri Oct 05, 2018 2:57 am
by fvapparel
@reyan123
Thank you for posting your solution...it worked for me!! Much obliged.