The target database is not configured for UTF-8 support - MySQL
Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.
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:
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:
alter database <database_name> character set utf8 collate utf8_bin;