Score:0

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

cn flag

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.

Score:0
cn flag

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.

pk flag
This answer works, thanks for sharing
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.