The target database is not configured for UTF-8 support - MySQL

Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.

Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Problem

When attempting to migrate to a MySQL database, the "test" fails and a warning it displayed in the UI:

The target database is not configured for UTF-8 support. For information about creating a database for user with Bitbucket, please refer to the Bitbucket documentation.

Troubleshooting

Running the following returns expected result set:

1 2 3 4 5 6 7 8 9 mysql> SELECT default_character_set_name FROM information_schema.SCHEMATA S WHERE schema_name = "<database_name>";     +----------------------------+ | default_character_set_name | +----------------------------+ | utf8 | +----------------------------+ 1 row in set (0.00 sec)

Cause

Bitbucket server will only work with utf8_bin collation. If utf8_general_ci is used, this error will be seen in the UI and migration to the external database will not be possible.

Resolution

Apply the correct collation:

1 alter database <database_name> character set utf8 collate utf8_bin;
Updated on April 8, 2025

Still need help?

The Atlassian Community is here for you.