Unanswered: Trying to import with this error ERROR 1062 (23000) at line 73: Duplicate entry '1' f
I'm trying to move a wordpress site to a different server.
I exported the database on the current server, but when I import it on the new server, I get this error:
ERROR 1062 (23000) at line 73: Duplicate entry '1' for key 1
I'm not sure how to fix that. On the current server, I was able to log into cpanel and go to phpmyadmin to view the database. I see the database and all the tables listed on the left side but I don't know what to do from there.
Can someone help me through this? I don't have much knowledge if any about databases but i feel like i'm really close??
The error comes when you have a table with either a primary key or unique key (or both) defined. So for example an employee table with empid and name. The field empid is the primary key and is unique. If you attempt to add a second entry with the same empid you will get this error. What you need to do is look at the data that it being added and make sure that there are no duplicates added.
Ok, thanks for your response. I'm not sure how to read the database. I have it open in phpmyadmin. I see on the tables listed on the left hand side. Does that error help me look for something specific. Once I click on a table should I be looking for something in there?
Sorry, I just never looked at databases before so this all looks really foreign to me.
PhpMyAdmin is a utility which allows you to look at the tables and data in your database. Unfortunately it will not show you the row that was causing the duplicate key error. The first thing to do is look at the definition of the table for either a primary key and/or a unique key. With these we then know where we have to start looking.
Once we know this we can have a look at loading the data into a separate table that looks identical to the its live version. With this we can then run an SQL statement to find out the offending rows.