MySQL 4.0: default character set affecting behaviour of UNIQUE
November 22nd, 2005
A few weeks ago I discovered that the default latin1 character set of the MySQL server does sorting by rules of the swedish character sets. This doesn’t work in my country so I choose latin1_de which handles umlauts properly.
What I didn’t expected is that this also affects the behaviour of the UNIQUE index. Before the change, the words ‘Grossschlögl’ and ‘Großschlögl’ where different. Now, after the change, the behavour due to my changed character set was, that these words where suddenly equal. And during an import I couldn’t import both words into the table because the column is a unique column. To successfully finish the import I had to temporarely use the old latin1 character set.
Entry Filed under: Coding
1 Comment Add your own
1. Dready | November 24th, 2005 at 20:21
Another nice thing:
After updating my MySQL with all the Collations i tried exporting a database in phpmyadmin and importing it anywhere else… ERROR..
After triing to use the ‘SQL export compatibility’ Option in phpmyadmin i was able to import the data, but the ‘umlaute’ where all wrong (utf8)…
The only possible sollution i found was using the console command mysqldump:
mysqldump –create-options –compatible=mysql40
bests, dready
Leave a Comment
Some HTML allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>
Trackback this post | Subscribe to the comments via RSS Feed