Issues with Database Character Set Migration Using tiup dmctl

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: tiup dmctl迁移数据库字符集问题

| username: TiDBer_30hewbUu

【TiDB Usage Environment】Test environment
【TiDB Version】5.4.2
【Encountered Problem】MySQL version is 5.1 with default character set utf8, which does not support utf8mb4. During data migration preparation, there was a character set error. Do I need to change TiDB’s default character set to utf8? If I change it, will there be any issues?
{
“result”: false,
“msg”: “[code=10001:class=database:scope=not-set:level=high], Message: database driver error, RawCause: Error 1115: Unknown character set: ‘utf8mb4’, Workaround: Please check the database connection and the database config in configuration file.”,
“sources”: [
]
}

| username: db_user | Original post link

I handled it this way before, hope it helps you:
You can use dumpling for data export, then use sed for character set text replacement, then use lighting for data import, and finally use dm for incremental updates.

Here are the character sets supported by TiDB, if needed:

| username: gary | Original post link

You can create a database with the utf8 character set on TiDB, then migrate data from MySQL to TiDB, and then perform character set conversion.