Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.
Original topic: tidb 用br备份还原后,授权相关的mysql库可以用Mysqldump的方式导出,再导入吗
tidb 5.0.3
The full backup of BR does not include the mysql database. Can the mysqldump method be used to export the user privilege database mysql and then import it into the new cluster?
You can use Dumpling to export the MySQL database and then use Lightning to import it.
dumpling -B mysql -f '*.*'
You can also use the combination of Mydumper and Myloader.
Or use BR to back up the MySQL database separately:
br backup db --db mysql
Can mysqldump also be used?
Hello, do the tables in the MySQL database contain schema information unique to each cluster? Will there be issues when importing into a new cluster? I already imported the full backup data into the TiDB cluster yesterday. If some tables in the online cluster are rebuilt today, the table information might change. I randomly checked two tables and noticed that some tables’ IDs and range information were recorded. If the tables are rebuilt, the table IDs will change, and the range information might not be accurate. Will there be issues when importing into the new cluster?
Hello, why does dumpling prompt that the mysql system database is not recognized?
I am using TiDB version 5.0.3. Does this version not support exporting the mysql database?
Yes, it is supported. This error is likely because only -B was added without -f. Try adding the -f parameter:
dumpling -h 127.0.0.1 -P 4000 -u root -t 16 -r 200000 -F 256MiB -B mysql -f 'mysql.*' -o /temp
I did not encounter the issue you mentioned in v5.4.0
Additionally, if you want to use mysqldump, it’s best to add the --hex-blob option because, based on my tests, without it, tables related to statistics might have garbled text issues.
Therefore, it is recommended to use tools from the TiDB ecosystem.
The compatibility supported by dumping should be better.
I’ve tried dumpling, mysqldump, and mydumper; all of them can be used for logical backups.
This topic was automatically closed 1 minute after the last reply. No new replies are allowed.