Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.
Original topic: 使用backup命令备份tidb的数据库的时候提示数据太长
[TiDB Usage Environment] Production Environment
[TiDB Version] v4.0.9
[Encountered Problem: Problem Description and Impact]
When using the backup command to back up the database, the following prompt is received:
Backup failed: [types:1406]Data Too Long, field len 2, data len 4
Take a look at this, it should be the same issue.
I have already checked, the backup command under sql> cannot add the ignore parameter, and there is no such parameter available in the backup command. So I don’t know what to do.
You can try executing br from the command line.
The BR command line documentation for version 4.0 is here: 使用 BR 命令行进行备份恢复 | PingCAP 归档文档站
Could you please let me know how large your tables are? First, back up the two tables below, then perform an analyze operation on all tables, and then back up again. If ignoring is not an option, recollecting the statistics should work. If analyze reports an error that the upper_bound length is insufficient, use the following operations:
ALTER TABLE mysql.stats_buckets MODIFY upper_bound LONGBLOB NOT NULL;
ALTER TABLE mysql.stats_buckets MODIFY lower_bound LONGBLOB;
ALTER TABLE mysql.stats_histograms MODIFY last_analyze_pos LONGBLOB DEFAULT NULL;
This was modified a long time ago.
@ablewang_xiaobo Is there any issue with using the BR command for backup?
I never had the chance to use BR, the client didn’t give me permission to log in later.
There should be no problem with BR, and there are a few more available parameters in BR.
This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.