MySQL Character Sets and Collations

From HostThyself

Jump to: navigation, search

Character Sets and Collations are important when storing languages other than English or multiple languages in the database.

Since MySQL AB, the company that produces MySQL, is a Swedish company, the default character set for MySQL had been latin1_swedish_ci historcially.

To set a diferent default character set ad collation, start MySQL with

mysqld --character-set-server=utf8 --collation-server=utf8_general_ci

Or edit /etc/my.cnf and add to the [mysqld] section

character-set-server = utf8
Personal tools