views:

277

answers:

2

I dropped all tables from a database then restore(import) a backup. and getting this error.

Should i repeat the process. or something else? Why this error is coming?

alt text

A: 

you have a duplicate value for a key. they must be unique

Galen
how? where? pls explain. I'm noob in mysql
metal-gear-solid
+1  A: 

This indicates that you have a UNIQUE or PRIMARY index on a table, and there is a duplicate value someone on one of the values in one of these indexes.

You'll need to look at which particular query (ie which line of your SQL) caused this error to find out which table and which row it was trying to write. phpMyAdmin should print out the SQL of the query that failed above that error shouldn't it?

One guess is that you're importing data that duplicates some data already in a table, ie you may not have removed the existing data like you thought you had. But it could be any number of things.

thomasrutter
i want to remove all previous tables from database and want to import from another sql file.
metal-gear-solid
@thomasrutter - I selected all tables then dropped. Is it not enough?
metal-gear-solid