Log in

View Full Version : Error 1062 (23000) duplicate entry


CrashfAB
04-28-2010, 05:08 PM
I am in the process of setting up a duplicate forum for reasons of testing.

I had my host pull me a database backup thru SSH.

I took the backup and went to restore it into a new database on another host I have. I ran the proper code mysql -u databaseuser -p databasename < backup.sql and all went good.

I then get a ERROR 1062(23000) at line 5458 : Duplicate entry 'jagermeister' for key 2

I have done as much reading as I can interpret with my slim knowledge of databases. from what I can tell this has to do with information being placed into the wrong tables due to hacks/plugins on my site? Am I wrong on this?

Any help would appreciated.

Speysider
04-28-2010, 05:26 PM
Duplicate entry key means that this key already exists and is trying to be made again.

CrashfAB
04-28-2010, 05:36 PM
I understand that (and I should have stated so) but how do I go about correcting it?

Speysider
04-28-2010, 06:34 PM
You would have to delete that table and recreate it being empty.
There was a better way of creating an entirely duplicate test forum, which was to use ImpEx.

CrashfAB
04-28-2010, 07:47 PM
You would have to delete that table and recreate it being empty.
There was a better way of creating an entirely duplicate test forum, which was to use ImpEx.

How can I tell what table it is?

I understand I can use ImpEx but I prefer to do things so I know how to. If I was to move my forum to another server I would be doing the same thing so might as well learn how to now.

Paul M
04-28-2010, 10:34 PM
View the database to see which table was created last.