Configuring UTF8 Character Set for MySQL
Last modified: 16 March 2021
To create a MySQL database which uses the UTF-8 character set:
Create a new database:
create database <database_name> character set utf8mb4 collate utf8mb4_bin
Open
<TeamCity Data Directory>/config/database.properties
, and add thecharacterEncoding
property:connectionProperties.characterEncoding=UTF-8
To change the character set of an existing MySQL database to UTF-8:
Shut down the TeamCity server.
From the
<TeamCity Home>/bin
directory, export the database using themaintainDB tool
:maintainDB backup -D -F database_backup
More details on this backup are here.
Create a new database with UTF-8 as the default character set, as described above.
Modify the
<TeamCity Data Directory>/config/database.properties
file by changing theconnectionUrl
property 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.