Configuring UTF8 Character Set for MySQL
Configuring UTF8 Character Set for MySQL
To create MySQL database with utf8 character set:
Create a new database: {{
CREATE DATABASE <database name> DEFAULT CHARACTER SET utf8{}}}Open
<TeamCity Data Directory> /config/database.propertiesfile, and add characterEncoding property: {{connectionProperties.characterEncoding=UTF-8{}}}
To change character set of an existing MySQL database to utf8:
Shut TeamCity server down.
Dump the database data to the file dump_data.sql: {{
mysqldump -t -u<user> -p<pass> <database>>dump_data.sql;{}}}Dump the database schema to the file dump_schema.sql: {{
mysqldump -d -u<user> -p<pass> <database>>dump_schema.sql{}}}Edit dump_schema.sql file. Remove DEFAULT CHARSET=<some charset> from the table and column definitions.
Create new database with the default charset utf8: {{
CREATE DATABASE <new database name> DEFAULT CHARACTER SET utf8;{}}}Import dump_schema.sql file into the new database: {{
mysql -u<user> -p<pass> <new database name> <dump_schema.sql{}}}Import dump_data.sql into the new database: {{
mysql -u<user> -p<pass> <new database name> <dump_data.sql{}}}Modify
<TeamCity Data Directory>/config/database.propertiesfile as follows:change connectionUrl property to:{{
jdbc:mysql://<host>/<new database name>{}}}add characterEncoding property:{{
connectionProperties.characterEncoding=UTF-8{}}}