Error During TiDB-Lightning Import

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

Original topic: tidb-lightning导入报错

| username: zhanggame1

[TiDB Usage Environment] Production Environment / Testing / Poc
[TiDB Version] v7.1.0
[Encountered Problem: Problem Phenomenon and Impact]
Using dumpling to import from MySQL 8, and using lightning to import into TiDB results in an error:
“[2023/07/31 10:47:10.575 +08:00] [ERROR] [main.go:103] [“tidb lightning encountered error stack info”] [error=”[Lightning:Restore:ErrCreateSchema]create schema failed, table: zabbix.game_draw_status, stmt: restore table schema: run create schema job failed: Error 1273 (HY000): Unsupported collation when new collation is enabled: ‘utf8mb4_0900_ai_ci’"]

It looks like a collation issue: Unsupported collation when new collation is enabled: ‘utf8mb4_0900_ai_ci’. How can this be resolved?

| username: CuteRay | Original post link

Just modify the SQL/csv files generated by dumpling, which contain the dbname-tablename-schema.sql files for creating tables and databases. Replace all instances of utf8mb4_0900_ai_ci with utf8mb4_general_ci.

| username: tidb菜鸟一只 | Original post link

Summarize into one command: sed -i "s/utf8mb4_0900_ai_ci/utf8mb4_general_ci/g" *.sql

| username: 扬仔_tidb | Original post link

I think this method works well.

| username: zhanggame1 | Original post link

Reliable, I’ll give it a try.

| username: zhanggame1 | Original post link

Improved it a bit, only need to change *schema.sql, no need to touch the data.

| username: system | Original post link

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.