ERROR 1062 (23000) at line 7633: Duplicate entry \'3-202\' for key 1

Started by mentorkyrom, November 14, 2008, 01:27:18 AM

Previous topic - Next topic

mentorkyrom

ERROR 1062 (23000) at line 7633: Duplicate entry '3-202' for key 1

this is the error I get when I try to restore my SQL file.

please help

ccbtimewiz

Look through your sql backup for the key (3, '302') and remove the duplicates.

mentorkyrom

Can you please advise the best way to view and edit a SQL file.

should I use MS Word so I can see the line numbers?

I tried searching for 3-202 and (3, '302')  (find function) but to no avail.


Thanks


Kindred

you shoudl never use MS word to edit anything that has to do with the web... especially not SQL or PHP files.

Get a text editor like ConText, NotePad++ or UltraEdit.


did you attempt to edit your backup file before it started showing that error?
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

mentorkyrom

No I didn't do anything to the file but extract it from it's sql.gz using winrar. Then I uploaded it to my godaddy dbbackups folder via FTP and attempted to restore. What I think is weird though is out of desperation I tried using even older backups from the collection of them that I have and all are reporting that same error.

I definatly do not <3 GoDaddy right now.

the top of the code is line 7633
INSERT INTO `smf_log_search_subjects`
(`word`, `ID_TOPIC`)
VALUES ('#', 1208),
('#', 1209),
(0, 1227),
(000, 926),
(01, 252),
(03, 202),
(03, 1226),
(04, 152),
(06, 202),
(07, 252),
(08, 152),
(08, 1141),
('08-10-08', 1138),
('0mg', 1163),

Kindred

why did you extract it?   You system should be able to read the GZ'ed file just fine
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

mentorkyrom

because i thought u had to?

And my default program winrar assumes you need to extract a .gz file on windows. Also the restore feature only allows .sql I think.

Also if I try to open the backup using context or notepad as a .gz file it looks like

Ê£.â RBÙ)ñz¢½÷Útw¡Þ͹øòÉ$XmÆs²Æ{â]ævŠaú0KÖK9ë^K"½Æ'ù"Ó]¶m/#¨Q,/©Hy´
gQTg¯P,Ç

Kindred

yes...   if you want to READ the SQL, then you have to extract it.
However, your web server system should be able to acess a gz file and extract it as part of the SQL load.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

mentorkyrom

Im trying to upload my SQL file to a new host using the import function within phpMyadmin.

here is the error

SQL query:

# # Dumping data in `smf_log_search_subjects` # INSERT INTO `smf_log_search_subjects` (`word`, `ID_TOPIC`) VALUES ('#', 1208), ('#', 1209), (0, 1227), (000, 926), (01, 252), (03, 202), (03, 1226), (04, 152), (06, 202), (07, 252), (08, 152), (08, 1141), ('08-10-08', 1138), ('0mg', 1163), (1, 92), (1, 114), (1, 170), (1, 265), (1, 268), (1, 404), (1, 546), (1, 553), (1, 631), (1, 893), (1, 1012), (1, 1038), (1, 1063), (1, 1206), (1, 1208), (10, 245), (10, 491), ('10-7', 1088), (100, 926), (11, 830), (11, 1225), (1100, 1025), (12, 168), (12, 358), (12, 650), (13, 962), ('1337est', 1163), ('13th', 642), (14, 71), ('14th', 739), (15, 1225), (17, 1227), (175, 995), (175, 1066), ('17th', 980), (1973, 151), (1989, 1025), ('19th', 437), (2, 110), (2, 214), (2, 223), (2, 232), (2, 235), (2, 345), (2, 469), (2, 615), (2, 661), (2, 880), (2, 901), (2, 1025), ([...]

MySQL said: 

#1062 - Duplicate entry '3-202' for key 1


mentorkyrom

Ok did that and attempted again, however all it did was report back the same error about (03, 1226) which was the next item down

removing that file fixed it.

TY so much for your help

Advertisement: