Error when importing MySQL using myloader

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

Original topic: 使用myloader导入mysql报错

| username: terry0219

[Test/Poc Environment] TiDB
[TiDB Version] 7.5.1
According to this document 从 TiDB 集群迁移数据至兼容 MySQL 的数据库 | PingCAP 文档中心, I tested migrating data from TiDB to MySQL. When using myloader to import, it reported an error “Segmentation fault”. The mydumper version is 0.10.1.

| username: GreenGuan | Original post link

You can try using the logical import and export tools dumpling and lighting provided by TiDB.

| username: tidb狂热爱好者 | Original post link

It feels like MySQL can’t handle the concurrency.

| username: tidb狂热爱好者 | Original post link

Try using MySQL’s own export tool to see if you can export a small table: mysqldump -h ip -uroot -ppassword dbname dbtable > dbsql.sql. If MySQL is not malfunctioning, it should be able to export.

| username: zhaokede | Original post link

Segmentation fault, this is an error reported by the software itself, right?

| username: Jjjjayson_zeng | Original post link

How about trying this? 从 TiDB 集群迁移数据至兼容 MySQL 的数据库 | PingCAP 文档中心

| username: terry0219 | Original post link

I followed this operation exactly.

| username: 像风一样的男子 | Original post link

You’ve already exported it as an SQL file, just source it into MySQL directly.

| username: vcdog | Original post link

Why do you want to migrate back to MySQL from TiDB? Is it a business requirement, or are you just testing the migration back? In principle, after migrating from MySQL to TiDB and using TiDB, you generally wouldn’t want to migrate back to MySQL.

| username: tidb狂热爱好者 | Original post link

I misread the topic, haha
mysql -h ip -uroot -ppassword dbname <dbsql.sql

| username: terry0219 | Original post link

The issue is with importing into MySQL, not exporting.

| username: terry0219 | Original post link

Oh, let me give it a try.

| username: terry0219 | Original post link

It is clear that there needs to be a fallback. It’s best if there are no issues, of course.

| username: riciny | Original post link

“Segmentation fault,” it seems like the software has an error. What is the runtime environment?

| username: terry0219 | Original post link

CentOS 7.9

| username: terry0219 | Original post link

There is no problem when using MySQL to import, but an error is reported after running for a while when using myloader to import.

| username: tidb狂热爱好者 | Original post link

TiDB is hundreds of times better than MySQL. TiDB is the ultimate choice.

| username: terry0219 | Original post link

There are many exported SQL files, and it’s not feasible to source them one by one. Is there a quicker way?

| username: Billmay表妹 | Original post link

  1. First, ensure that you have prepared the TiDB and MySQL databases according to the steps provided in the documentation and have backed up the TiDB data using the mydumper tool.
  2. The “Segmentation fault” error when using myloader to import data is usually caused by a program crash. This may be due to incompatible versions of mydumper and myloader.
  3. Based on the information you provided, you are using mydumper version 0.10.1. It is recommended to try upgrading mydumper to the latest version to ensure compatibility with myloader. The latest version of mydumper may have fixed some bugs and compatibility issues.
  4. After upgrading mydumper, back up the TiDB data again using mydumper and try importing the data into the MySQL database using myloader. Ensure that the “Segmentation fault” error does not occur during the import process.
  5. If the problem persists, you can try checking the myloader log files for more detailed error information. Log files usually record the cause of the program crash, which can help further troubleshoot the issue.
| username: terry0219 | Original post link

Using the latest mydumper version 0.16, an error occurs during import: “** (myloader:3710): ERROR **: 10:23:34.837: Global metadata file processing was not possible”