Friday 22 April 2011

enable UTF8 for all future tables in MySQL

If you want to store strings != english then you have to enable UTF8 in MySQL.





1) set the tables with the InnoDB Storage Engine

edit /etc/mysql/my.cnf:
[mysqld]
default-table-type=innodb



2) enable UTF8

edit /etc/mysql/my.cnf:
[mysqld]
## support for UTF8 (eg greek)
default-character-set=utf8
collation_server=utf8_unicode_ci
character_set_server=utf8


No comments:

Post a Comment