do i have to recompile it?
i figured out diffent ways of setting the character set values see
http://dev.mysql.com/doc/refman/5.5/en/charset.html
but starting it with other values or my.cnf settings changed nothing. Because if i do:
sudo mysqld --verbose --help | grep charact
it always answers me latin1 as standard charset. the system is ubuntu lts server with a standard mysql install.
To change the character set encoding to UTF-8 for the database itself, type the following command at the mysql> prompt. Replace dbname with the database name: Copy ALTER DATABASE dbname CHARACTER SET utf8 COLLATE utf8_general_ci; To exit the mysql program, type \q at the mysql> prompt.
The MySQL server has a compiled-in default character set and collation. To change these defaults, use the --character-set-server and --collation-server options when you start the server.
MySQL supports multiple Unicode character sets: utf8mb4 : A UTF-8 encoding of the Unicode character set using one to four bytes per character. utf8mb3 : A UTF-8 encoding of the Unicode character set using one to three bytes per character.
add this into my.cnf:
[mysqld]
character-set-server=utf8
character-sets-dir=/usr/share/mysql/charsets
default-character-set=utf8
[mysql]
character-sets-dir=/usr/share/mysql/charsets default-character-set=utf8
[mysqladmin]
character-sets-dir=/usr/share/mysql/charsets default-character-set=utf8
[mysqlcheck]
character-sets-dir=/usr/share/mysql/charsets default-character-set=utf8
[mysqldump]
character-sets-dir=/usr/share/mysql/charsets default-character-set=utf8
[mysqlimport]
character-sets-dir=/usr/share/mysql/charsets default-character-set=utf8
[mysqlshow]
character-sets-dir=/usr/share/mysql/charsets default-character-set=utf8
#end
[mysqld]
collation-server = utf8_unicode_ci
init-connect='SET NAMES utf8'
character-set-server = utf8
skip-character-set-client-handshake
[client]
default-character-set = utf8
[mysql]
default-character-set = utf8
UPDATE: Nowadays you should probably use utf8mb4.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With