I was expecting strange mySQL behavior when using the varchar field encoded in utf8 as the primary key. It does not work with a repeating key error for strings that are not equal in my development environment.
A brief example:
SET NAMES 'utf8'; CREATE TABLE `test` ( `id` varchar(5) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; INSERT INTO `test` (`id`) VALUES ('das'), ('daß');
Error with error: Duplicate entry 'daß' for key 'PRIMARY'.
I am running mySQL 5.5.35 on ubuntu 13.10 with the default setting.
On another mySQL server (version 5.0.95), the same queries did not work. Is this because of the mySQL version or is there a configuration option to set the encoding of index tables?
I encountered this problem when trying to import a mySQL dump from a productive server into a development environment.
source share