Configuring UTF8 Character Set for MySQL
To create a MySQL database which uses the utf8 character set:
-
Create a new database:
create database <database_name> character set UTF8 collate utf8_bin -
Open
<TeamCity Data Directory>/config/database.properties, and add thecharacterEncodingproperty:connectionProperties.characterEncoding=UTF-8
To change the character set of an existing MySQL database to utf8:
-
Shut the TeamCity server down.
-
From the
<TeamCity Home>/bindirectory, export the database using themaintainDB tool:maintainDB backup -D -F database_backupMore details on this backup are here.
-
Create a new database with utf8 as the default character set, as described above.
-
Modify the
<TeamCity Data Directory>/config/database.propertiesfile by changing theconnectionUrlproperty to:jdbc:mysql://<host>/<new_database_name> -
Import data the new database:
maintainDB restore -D -F database_backup -T <TeamCity Data Directory>/config/database.properties -
Start the TeamCity server.