Change your existing OSW/Openfire database in UTF

Skip to first unread message

Diana Cheng

Feb 18, 2011, 4:59:08 PM2/18/11
to onesocialweb
Hello there,

Since we have some new international members, we realized that our
database was not set to work with utf8. If you are running Openfire
with a MySQL backend it is easy to change the configuration of mysql
to character set utf8, but that will not alter existing databases. It
is also necesary to alter the existing tables. Here are the necessary

1)Backup your database (this is very important, and under YOUR OWN
2)Edit the my.cnf file in your MySQL installation (in a linux debian-
based distribution this is located in /etc/mysql). Add the following:

in section [client]

default-character-set = utf8

in section [mysqld]

init-connect='SET NAMES utf8'

in section [mysql]

default-character-set = utf8

3)Run the following script (replace with the right name of your
database in the first line):
4) Maybe restart MySQL (sudo /etc/init.d/mysql restart)

That will allow to show characters in most languages correctly for the
activities, jabber account info, profile, etc.

I read in the openfire documentation that the JDBC driver url should
also be changed but I did not find that necessary. Here is the article
in case you need to refer to it:

Hope you find this useful.

Reply all
Reply to author
0 new messages