#321505 mysql-server: charset and collation

#321505#5
Date:
2005-08-05 22:24:48 UTC
From:
To:
after installing the server, the default charset is latin1 (which is more or
less ok on a lot of systems, however I think it should be a debconf
question). For example latin9 or utf8 are often requested, too.

I also think that latin1_swedish_ci is a pretty bad default colaltion for
latin1. I would sugegst to use the bin collation or always ask for it.

I think the collation is not so critical, since it can be changed, but for
the charset a question before the DB is created is usefull.

Gruss
Bernd

#321505#10
Date:
2005-08-06 11:08:01 UTC
From:
To:
Hello Bernd
No, I would consider this as abuse of Debconf; when I start asking the default
locale, 100 other equally important things come to my mind and I would have to
start deciding which ones to ask and which not :) Things like "should the
server be started" or "should the db be purged after removing" which are
needed by the Debian scripts are proper things to ask via Debconf only.
Collation is the definition in which order to sort characters, right? What's
the difference between the both and which are the relevant config options?
Try "ALTER TABLE xyz CHARSET utf8;"?

bye,

#321505#15
Date:
2005-08-06 18:12:51 UTC
From:
To:
In that  case please use the systems default locale, not any aribitary
(wrong) one.

That does not change  the database' default charset or collation. I am not
sure if that is possible?

Bernd

#321505#20
Date:
2005-08-14 13:00:40 UTC
From:
To:
found 321505 mysql-server-4.1
found 321505 mysql-server-5.0
tags 321505 + wontfix
thanks

Hello Bernd

I've just read the documentation about MySQL collates. There are some
points which speak against changing the current default:
 - MySQL does not have a collation for every possible locale and for some,
   like German, there exists even more than one possibilities. So chosing the
   right one is difficult and would require some explanation if done manually.
 - Automatically deciding which is the right one, may be impossible as
   "root" often has set LC_ALL=C.
 - It would differ from all other distributions and the existing
   behaviour so might break applicatins which expect it the way it currently
   is.
 - It's no big deal as you can change the charset and collation server-wide
   vi /etc/mysql/my.cnf or with SQL commands for databases, tables,
   single columns and even for individual SELECTs.

I leave this report open, tagged as "wontfix", for reference.

bye,

#321505#27
Date:
2005-08-14 17:04:29 UTC
From:
To:
I know that 4.1 has the alter table, it has it not for 4.0. what  happens if
you change  the charset for tables which have already data in it, will it be
converted?

Well, I agree with the wontfix, perhaps an upstream  report would be good,
because for example there is no latin9 (iso-8859-15) charset which contains
euro.

Greetings
Bernd

#321505#32
Date:
2005-08-14 18:29:51 UTC
From:
To:
Hello Bernd
I don't think that there's a need for convertion. In you case it would still
be charset "latin1" but a different collation ("latin1_german1_ci" instead of
"latin1_swedish_ci"). A collation though is only a rule that gets
applied but no change in the binary representation. Given this, yes, altering
the table affectes everything that has been stored in it before (I tried it).
Yes, feel free to file a bug at dev.mysql.com. Regarding the Euro sign, latin1
is at least capable of storing it. Using ord() you can even see that latin1 is
in fact latin9 :-) (well, that's stricty spoken a bug for itself in case
anybody needs the "currency sign" :-))

bye,

#321505#37
Date:
2006-09-04 09:57:38 UTC
From:
To:
Hello,
I really don't understand why latin1_swedish_ci is used as default instead of latin1_general_ci
which is "general" as its name says...

#321505#42
Date:
2006-09-04 10:13:31 UTC
From:
To:
Backwards compatibility with older mysql versions.

bye,

#321505#57
Date:
2013-09-26 09:04:11 UTC
From:
To:
If you need fix this bug for many comps use
bugfix-321505 package
in https://launchpad.net/~ivan1986/+archive/ppa
it's only put mysqld_charset.cnf in /etc/mysql/conf.d/
whis

[mysqld]
character-set-server = utf8

[mysql]
default-character-set=utf8