__To create a MySQL database which uses the utf8 character set:__
1. Create a new database:
```SQL
create database <database_name> character set UTF8 collate utf8_bin
```
2. Open `<[TeamCity Data Directory](teamcity-data-directory.md)>/config/database.properties`, and add the `characterEncoding` property:
```Plain Text
connectionProperties.characterEncoding=UTF-8
```
2. Open `<[TeamCity Data Directory](teamcity-data-directory.md)>/config/database.properties`, and add the `characterEncoding` property:
```Plain Text
connectionProperties.characterEncoding=UTF-8
```
is not necessary because the driver automatically detects the coalition. even the comment in the database.properties
states
# Specifies whether the driver should use Unicode character encodings
# when handling strings. Should only be used when the driver cannot determine
# the character set mapping, or you are trying to 'force' the
# driver to use unicode
There is also an additional way of changing the coalition withoutn needing to create a new database like the following
__To change the character set of an existing MySQL database to utf8:__
1. Shut the TeamCity server down.
2. From the `<[TeamCity Home](teamcity-home-directory.md)>/bin` directory, export the database using the `maintainDB tool`:
```Plain Text
maintainDB backup -D -F database_backup
```
More details on this backup are [here](creating-backup-via-maintaindb-command-line-tool.md#Performing+TeamCity+Data+Backup+with+maintainDB+Utility).
3. Change the database coalition with
```Plain Text
ALTER DATABASE teamcitydb CHARACTER SET UTF8 COLLATE utf8_bin;
```
4. Change the table coalition with:
```Plain Text
USE INFORMATION_SCHEMA;
SELECT
CONCAT("ALTER TABLE `", TABLE_SCHEMA,"`.`", TABLE_NAME, "` CONVERT TO CHARACTER SET UTF8 COLLATE utf8_bin;")
AS MySQLCMD FROM TABLES
WHERE TABLE_SCHEMA = "teamcitydb";
```
5. Execute the above commands.
6. Start the TeamCity server.
CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;