If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > Trying to import with this error ERROR 1062 (23000) at line 73: Duplicate entry '1' f

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-19-11, 12:57
wordy26 wordy26 is offline
Registered User
 
Join Date: Nov 2011
Posts: 2
Trying to import with this error ERROR 1062 (23000) at line 73: Duplicate entry '1' f

Hi,

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??

Thanks so much in advance!!!
Reply With Quote
  #2 (permalink)  
Old 11-19-11, 13:53
it-iss.com it-iss.com is offline
Registered User
 
Join Date: Sep 2009
Location: San Sebastian, Spain
Posts: 620
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.
__________________
Ronan Cashell
Senior Oracle/MySQL DBA
http://www.it-iss.com
Reply With Quote
  #3 (permalink)  
Old 11-19-11, 14:06
wordy26 wordy26 is offline
Registered User
 
Join Date: Nov 2011
Posts: 2
thanks

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.
Reply With Quote
  #4 (permalink)  
Old 11-19-11, 15:54
it-iss.com it-iss.com is offline
Registered User
 
Join Date: Sep 2009
Location: San Sebastian, Spain
Posts: 620
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.
__________________
Ronan Cashell
Senior Oracle/MySQL DBA
http://www.it-iss.com
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On