Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

In phpmyadmin, when I try to import the database, I get this error: http://i.stack.imgur.com/iDBfE.png

I do not understand why it wont let me import it. Im running RedHat x86_64 es5. Both my old and new server are matching in settings and versions. Both are running MySQL 5.1

What is going on? Can anyone please assist me in solving this mystery? Im not very experienced so please be specific in any answer...

share|improve this question
add comment

2 Answers

This error is due to a mismatch between the table definitions and the table contents.

At some point a unique index for the field longitude was added, but the previous existing data wasn't checked, and there was a duplicate entry for that index, so it can't be unique.

You have a couple of options to get this solved

  • Remove the duplicate entry if it's really redundant
  • If you actually need that entry modify through phpmyadmin the table in order to drop the UNIQUE attribute on the index over the field longitude

Let me know how it goes! ;)

share|improve this answer
    
Let me try this, I will get back to you in a few minutes... –  Micky_mike Jan 30 '11 at 16:58
    
Sure! Good luck –  lynxman Jan 30 '11 at 17:00
    
Bad news, I just did a search for duplicates and there were none. I think mysql rounds up the numbers upon either export or import and thats whats causing this. Do you have any idea what I can do? –  Micky_mike Jan 30 '11 at 17:33
    
Hm looks like the key is a composed one of lon and lat, check the dump as well, it should be there, otherwise you would not get that error :/ –  lynxman Jan 30 '11 at 17:35
1  
@lynxman please view serverfault.com/questions/228871/… –  Micky_mike Jan 30 '11 at 18:49
show 1 more comment

Within your table "city" there is a field called "longitude". You have (intentionally or not) configured this field to be unique. However, when you load your database to the new server there is already a record for longitude "144.967--37.8167". As a consequence, you get this error. You can remove this record, or make "longitude" not unique anymore before importing the database.

share|improve this answer
    
longitude is key, it's not field. –  alvosu Jan 30 '11 at 16:48
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.