just2blue4u
26.09.08, 08:59
Hallo Forum,
Unser MySQL-Server (mysql-server-5.0.27-1.fc5 RPM) unter Fedora Core 5 arbeitet Standardmäßig mit dem latin1 Zeichensatz und der entsprechenden Collation.
Nun würden wir gerne den Serverstandard auf UTF-8 und die Collation "utf8_unicode_ci" stellen.
Im MySQL-Handbuch steht dazu:
In MySQL 5.0, character set and collation are specified separately. This means that if you want German sort order, you should select the latin1 character set and either the latin1_german1_ci or latin1_german2_ci collation. For example, to start the server with the latin1_german1_ci collation, use the --character-set-server=latin1 and --collation-server=latin1_german1_ci options.
...
Posted by Markus Kersting on September 23 2003 8:18pm [Delete] [Edit]
Bei den Versionen 4.0.x bis Version sollte es im Normalfall mit "latin1_de" funktionieren. Entweder als der Kommandozeilenparameter für mysqld und mysqlimport:
--default-character-set=latin1_de
oder in der my.cnf:
default-character-set=latin1_de
Ich habe also folgendes in der my.cnf ausprobiert, aber alles wurde ignoriert:
#default-character-set=UTF8
#default-collation=utf8_unicode_ci
#character-set-server=UTF8
#collation-server=utf8_unicode_ci
Daraufhin habe ich die Parameter direkt an den Startaufruf im Initscript hinzugefügt:
/usr/bin/mysqld_safe --defaults-file=/etc/my.cnf --pid-file="$mypidfile" --log-error="$errlogfile" --character-set-server=UTF8 --collation-server=utf8_unicode_ci >/dev/null 2>&1 &
Erst das sorgte dafür, dass der Server Datenbanken und Tabellen standardmäßig als UTF8 anlegt.
Meine Frage:
Was muss ich in die my.cnf schreiben, um UTF-8 als Standard zu kommen? Ich finde den Workaround mit angepasstem Initscript sehr hässlich :(
Beste Grüße,
Heiner
Unser MySQL-Server (mysql-server-5.0.27-1.fc5 RPM) unter Fedora Core 5 arbeitet Standardmäßig mit dem latin1 Zeichensatz und der entsprechenden Collation.
Nun würden wir gerne den Serverstandard auf UTF-8 und die Collation "utf8_unicode_ci" stellen.
Im MySQL-Handbuch steht dazu:
In MySQL 5.0, character set and collation are specified separately. This means that if you want German sort order, you should select the latin1 character set and either the latin1_german1_ci or latin1_german2_ci collation. For example, to start the server with the latin1_german1_ci collation, use the --character-set-server=latin1 and --collation-server=latin1_german1_ci options.
...
Posted by Markus Kersting on September 23 2003 8:18pm [Delete] [Edit]
Bei den Versionen 4.0.x bis Version sollte es im Normalfall mit "latin1_de" funktionieren. Entweder als der Kommandozeilenparameter für mysqld und mysqlimport:
--default-character-set=latin1_de
oder in der my.cnf:
default-character-set=latin1_de
Ich habe also folgendes in der my.cnf ausprobiert, aber alles wurde ignoriert:
#default-character-set=UTF8
#default-collation=utf8_unicode_ci
#character-set-server=UTF8
#collation-server=utf8_unicode_ci
Daraufhin habe ich die Parameter direkt an den Startaufruf im Initscript hinzugefügt:
/usr/bin/mysqld_safe --defaults-file=/etc/my.cnf --pid-file="$mypidfile" --log-error="$errlogfile" --character-set-server=UTF8 --collation-server=utf8_unicode_ci >/dev/null 2>&1 &
Erst das sorgte dafür, dass der Server Datenbanken und Tabellen standardmäßig als UTF8 anlegt.
Meine Frage:
Was muss ich in die my.cnf schreiben, um UTF-8 als Standard zu kommen? Ich finde den Workaround mit angepasstem Initscript sehr hässlich :(
Beste Grüße,
Heiner