1062 Duplicate Entry Error Fix
#41
Posted 14 February 2009, 10:52
1062 - Duplicate entry 'li20tl2he6pen6fd35vtpm5q75' for key 1
insert into sessions values ('li20tl2he6pen6fd35vtpm5q75', '1234550946', 'language|s:7:\"english\";languages_id|s:1:\"1\";selected_box|s:13:\"configuration\";')
Using my phpmyadmin 2.11.9 I looked for the "sessions" configuration and noticed that the index value for the utilized space was corrupted and red colored.
I used the phpmyadmin optimizer. The index was dimensioned to 4,096 B, black colored, and the problem was solved.
Hope this can help you.
#42
Posted 24 March 2009, 12:35
i have the same problem...for some reasons, i cannot edit a product..i can add it to multiple categories (usine Multiplecategories mod) but when i try to edit the product i get the following error :
1062 - Duplicate entry '38-26' for key 1
insert into products_to_categories (products_id, categories_id) values ('38', '26')
[TEP STOP]
and obviously it does not record my changes...i went trough the forums and tryed various solutions including those on this topic ..but did not work out..
any ideas ?
Kyli
#43
Posted 08 April 2009, 00:39
dany_134, on Feb 14 2009, 11:52 AM, said:
1062 - Duplicate entry 'li20tl2he6pen6fd35vtpm5q75' for key 1
insert into sessions values ('li20tl2he6pen6fd35vtpm5q75', '1234550946', 'language|s:7:\"english\";languages_id|s:1:\"1\";selected_box|s:13:\"configuration\";')
Using my phpmyadmin 2.11.9 I looked for the "sessions" configuration and noticed that the index value for the utilized space was corrupted and red colored.
I used the phpmyadmin optimizer. The index was dimensioned to 4,096 B, black colored, and the problem was solved.
Hope this can help you.
This worked for me.
#44
Posted 22 April 2009, 06:34
#45
Posted 27 April 2009, 11:54
I had the following on a client's site that was running a clean OsC2.2 which I then added the SPPC mod to:
Quote
insert into products_groups (customers_group_id, customers_group_price, products_id) values ('', '', '133')
[TEP STOP]
This error occured when the client tried to use the duplicate product function. After reading this thread about 10 times over along with a lot of other forums posts elsewhere on 1062s, I saw the pattern between everyone's error and worked out why my client was getting his.
As I understand a 1062 happens because somewhere in your database a field is not auto-incrementing when it should be. The error tells you which database table to look in (in the case I quote above it was products_groups). Try setting the first field (in this case customers_group_id) to auto-increment. This will then prevent the duplicate entries. I hope that helps those of you that are having trouble.
Happy OsC'ing,
Dani
Edited by danigirl168, 27 April 2009, 11:54.
#46
Posted 31 July 2009, 19:20
The error happens when I try to add a new, or update an existing product!
Any other solutions?
1062 - Duplicate entry '0-0' for key 1
insert into products_to_categories (products_id, categories_id) values ('0', '0')
[TEP STOP]
I've narrowed it to "admin/categories.php... Started after installing the SPPC mod!
danigirl168, on Apr 27 2009, 07:54 AM, said:
I had the following on a client's site that was running a clean OsC2.2 which I then added the SPPC mod to:
This error occured when the client tried to use the duplicate product function. After reading this thread about 10 times over along with a lot of other forums posts elsewhere on 1062s, I saw the pattern between everyone's error and worked out why my client was getting his.
As I understand a 1062 happens because somewhere in your database a field is not auto-incrementing when it should be. The error tells you which database table to look in (in the case I quote above it was products_groups). Try setting the first field (in this case customers_group_id) to auto-increment. This will then prevent the duplicate entries. I hope that helps those of you that are having trouble.
Happy OsC'ing,
Dani
#47
Posted 20 February 2011, 17:13
Error
SQL query:
ALTER TABLE `sessions` CHANGE `sesskey` `sesskey` INT( 32 ) NOT NULL
MySQL said:
#1062 - Duplicate entry '0' for key 1
Does anyone know why I get this?
#48
Posted 30 July 2011, 12:25
If you have problems and cant use your mysqladmin/phpmysqladmin or other mysql server software corectly,
dump the sessions table with this code:
DROP TABLE IF EXISTS sessions;
CREATE TABLE sessions ( sesskey int(32) NOT NULL auto_increment, expiry int(11) unsigned NOT NULL, value text NOT NULL, PRIMARY KEY (sesskey) );
If you are done, delete the osc Cokkies in your browser, reload the side and WOW ... ^^
Best regards Peter
"Edit: one ask i have about this error: on the 2.2RC2a i dont get this error with this sessions table:
CREATE TABLE `sessions` ( `sesskey` varchar(32) NOT NULL default '', `expiry` int(11) unsigned NOT NULL default '0', `value` text NOT NULL, PRIMARY KEY (`sesskey`) ) ENGINE=MyISAM;
So i wonder me now
Edit end
Edited by BdMdesigN, 30 July 2011, 12:39.
#49
Posted 30 July 2011, 13:08
Now after this fix, i cant go on the Admin Page: Cookie problems ?!?
"Fehler: Umleitungsfehler
Die aufgerufene Website leitet die Anfrage so um, dass sie nie beendet werden kann.
* Dieses Problem kann manchmal auftreten, wenn Cookies deaktiviert oder abgelehnt werden."
#50
Posted 30 July 2011, 17:39
BdMdesigN, on 30 July 2011, 13:08, said:
Now after this fix, i cant go on the Admin Page: Cookie problems ?!?
"Fehler: Umleitungsfehler
Die aufgerufene Website leitet die Anfrage so um, dass sie nie beendet werden kann.
* Dieses Problem kann manchmal auftreten, wenn Cookies deaktiviert oder abgelehnt werden."
Im again, ok i have update my php5 Version to 5.3.7RC4-dev (Zend: 2.3.0), downloaded the osc 2.3.1 again today, delete all files on space, DB Tables and cookies in Browser, install again and its works (DB fix inclusive).
#51
Posted 04 February 2012, 23:55
1062 - Duplicate entry '367-2' for key 1
insert into products_description (products_name, products_description, products_url, products_id, language_id) values ('', '', '', '367', '2')
[TEP STOP]
Peter you missed a beat.
This works well by emptying out the sessions and renew the DB. However, when you added the entries back you didn't specify what Collation. I don't believe the sesskey should be INT or auto_increment, the security is certianly an issue. So, here is what I did once the DB was refreshed using Peter's suggestion:
Change sesskey to Type: VARCHAR, Length/Values: 64, Collation: latin1_swedish_ci and that's it! Nothing else. As you can see I sent the Length/Values up to 64, based upon the rest of the forums suggestion. This fixed the problem for me, hope it helps someone else!
Edited by geomilli, 04 February 2012, 23:56.














