I have run this command:-

 mysql -u magento -p database < database_file.sql

I have got the error:-

ERROR 1062 (23000) at line 5447: Duplicate entry '7-41-0' for key 'catalog_category_entity_int.CATALOG_CATEGORY_ENTITY_INT_ENTITY_ID_ATTRIBUTE_ID_STORE_ID'

How to solve this error?

2 Answers 2


first get backup and import into your local database with below updating of your sql file.

Drop DB and create again same name DB. and import sql script with below changes.

Add before table data insert line.


And End of your sql file add


It will stop for check foreign key durring your sql import script, You must be enable at last.


The error is actually self explanatory, there are one or more duplicate row values for one or more columns. There is simply a constraint on it so it may mot occur. Your source databases is corrupt (for this table). It happens allot actually.

I don’t have the schema in front of me. But if you look at it closely you should have to figure it out.

You can also look at the constraint itself since it will explain which column(s) the constraint is on.

Deleting the duplicate rows will make the DB import proceed.

But be careful, since you are deleting data which may mess up stuff. Only when the entire row is identical it won’t hurt deleting is since the other copy will remain in tact.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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