OpenFire default configuration after connecting to MySQL database, Chinese garbled.
Workaround:
MySQL character set to UTF8
+ Set Global character sets
SET @ @global. character_set_client = UTF8;
SET @ @global. character_set_results = UTF8;
SET @ @global. character_set_connection = UTF8;
SET @ @global. character_set_server = UTF8;
+ Set the current connection character set
SET @ @session. character_set_client = UTF8;
SET @ @session. character_set_results = UTF8;
SET @ @session. character_set_connection = UTF8;
Or:
SET names UTF8;
Modify the database connection string for OpenFire, and if it is a new openfire, set the following connection string in the database settings of the management side:
jdbc:mysql://[database]:3306/[databasename]?rewritebatchedstatements=true&useunicode=true& Characterencoding=utf8
If OpenFire is already set up, modify the connection string in ServerURL in the configuration file Conf/openfire.xml:
<database>
<defaultProvider>
<driver>com.mysql.jdbc.Driver</driver>
<serverurl>jdbc:mysql://[databaseip]:3306/[databasename]?rewritebatchedstatement
S=true&useunicode=true&characterencoding=utf8</serverurl>
</defaultProvider>
</database>
OpenFire connection to MySQL database character set problem resolution