Mysql: change default encoding

Let’s say you want to change default encoding for mysql from latin1 to utf8, simply add the following lines to /etc/mysql/my.cnf under [mysqld] section:

#default-character-set = "utf8" #comment: this one is not working
collation-server = "utf8_general_ci"
character-set-server = "utf8"

Don’t forget to reload mysql server (/etc/init.d/mysql restart)

That’s it.


Post a Comment

Your email is never published nor shared. You're allow to say what you want...