Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.Original topic: MYSQL数据迁移到TIDB
How can I quickly migrate 210,000 tables from MySQL to TiDB?
Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.Original topic: MYSQL数据迁移到TIDB
How can I quickly migrate 210,000 tables from MySQL to TiDB?
Depending on the total data size, you can use mysqldump to export and then load the data into TiDB.
Can mysqldump export so many tables? It didn’t seem to work before. Are there any parameters that need to be adjusted?
Moreover, mysqldump takes quite a long time. Is there a faster method?
Considering the total amount of data, if they are all small tables, you can use DM directly in one step without any extra operations. If the amount is large, it’s better to use Dumpling + Lightning.
If it’s just 210,000 tables, the mysqldump I mentioned would be completely sufficient. If you also need to consider the data volume, then you need to decide on the method based on the data volume.
There are just many tables, but the data volume in each table is not large.
Can the mysqldump output be directly sourced using the mysql client?
TiDB has Dumpling, and using it to export MySQL is also not a problem.
Export with Dumpling, then import with Lightning. I don’t see any limitations on the number of tables in a single database. For other limitation information, please refer to the documentation: TiDB 使用限制 | PingCAP 文档中心
I encountered this problem during import. There is only the table structure, no data in the table. Can you help me take a look?
The cluster’s PD appears to be running, and the port is also functioning normally. Is there any solution for this?
Did you choose physical import or logical import? I didn’t understand the configuration file.
I don’t quite understand how to write the configuration file. It’s about exporting the MYSQL data from server A, copying the exported SQL to server B, and importing it into TIDB. Which method should I choose for this?
First, take a look at the documentation to get an understanding:
Refer to the configuration file
TiDB Lightning Configuration Parameters | PingCAP Documentation Center
mysqldump single-threaded is a bit slow. How about trying mysqlpump or mydumper directly?