Issue with duplicate keys


I’m having a issue with duplicate keys. For some reason MySQL is saying that:

“Sóifón” is a duplicate key, when it is not (There are NO records with the same key, I’m checked, checked and checked again). The closest to it is “Sóifon”.

I am getting this error from a SQL dump made on a MySQL 5.1.41 server and I am importing it into a MySQL 5.1.37 server (It works if I import it to the 5.1.41 server)

On the server I’m trying to import to I’ve made sure that the database is using utf8 with a default collation of utf8_unicode_ci (This is the server default on the server that made the dump via phpmyadmin but is NOT on the server I’m importing to) but it keeps insisting that Sóifón is a duplicate key to Sóifon when importing via phpMyAdmin.

What is causing this issue?



Without seeing the dump of create table statement, we could be guessing forever but one thing is for sure - there are duplicate keys.
Check if your create table statement doesn’t contain different charset to utf8.

I’ve been through the dump line by line for the insert statements and there are no duplicate keys of “Sóifón” (Again, the closest match is the one I mentioned above and to me it is not a duplicate key but appears to be so to MySQL) also the create table statement is set for a charset of utf8 and sets the default collation on the table of utf8_unicode_ci

Edit: Update, I fixed this by changing the collation on the table from utf8_unicode_ci to utf8_bin