When importing a dump from a production site with mysql in a xampp environment I got this error:

ERROR 1062 (23000): Duplicate entry '/-de' for key 'PRIMARY'

These lines are affected:

ALTER TABLE `redirect_404`
ADD PRIMARY KEY (`path`,`langcode`);

Strangely when importing the sql file into another database on the production server, it doesn't show any error.

2 Answers 2


There are many many posts about this error on the internet, but only in one I found the solution: https://dba.stackexchange.com/questions/46803/1062-duplicate-entry-but-there-are-no-duplicates/202891#202891

Apparently there was a value that should be entered in the path column which is longer than the defined 191 bytes, so it was truncated to that length, which caused duplicate values. So the solution is to clear all 404 log entries on /admin/config/search/redirect/settings and export the database again.

  • This answer works, thanks for sharing Commented May 17, 2023 at 8:13

This is what's happening to us. We have to clear the redirect_404 table all the time because they aren't sanitizing their primary key correctly.


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.