tidb-lightning 导入日志有报错:“restore table db.tbl failed: obtain GC lifetime failed: Error 1142: SELECT command denied to user ‘test’@‘192.168.%’ for table ‘tidb’”

【TiDB 版本】:4.0.4
【问题描述】:通过tidb-lightning local模式导入数据,导入是成功的,数据已经被导入,但是日志最后报错如下,是什么原因

[ERROR] [restore.go:605] [“restore table failed”] [table=db_img.project_pic] [takeTime=18m1.12739272s] [error=“restore table db_img.project_pic failed: obtain GC lifetime failed: Error 1142: SELECT command denied to user ‘test’@‘192.168.%’ for table ‘tidb’”]

1.使用什么命令导入的?用户是否有权限?
2. 当前库里可以查询这个表吗?导入的数据是否完整

nohup ./tidb-lightning -config tidb-lightning.toml > nohup.out &

[lightning]

# 转换数据的并发数,默认为逻辑 CPU 数量,不需要配置。
# 混合部署的情况下可以配置为逻辑 CPU 的 75% 大小。
region-concurrency = 6

# 日志
level = “info”
file = “tidb-lightning.log”

[tikv-importer]
# backend 设置为 local 模式
backend = “local”
# 设置本地临时存储路径
sorted-kv-dir = “/tmp/test/tidb”

[mydumper]
# Mydumper 源数据目录。
data-source-dir = “/tmp/test/import_data”

[tidb]
# 目标集群的信息。tidb-server 的监听地址,填一个即可。
host = “”
port = 4000
user = “test”
password = “”
# 表架构信息在从 TiDB 的“状态端口”获取。
status-port = 10080

±------------------------------------------------------------+
| Grants for test@192.168.% |
±------------------------------------------------------------+
| GRANT USAGE ON . TO ‘test’@‘192.168.%’ |
| GRANT ALL PRIVILEGES ON db_img.* TO ‘test’@‘192.168.%’ |
±------------------------------------------------------------+

权限是有的,库里可以查询到这个表,数据条数也没有错。
但是再导入其他表就会报错(如下)
Error: TiDB Lightning has detected tables with illegal checkpoints; please remove these checkpoints first
tidb lightning encountered error: TiDB Lightning has detected tables with illegal checkpoints; please remove these checkpoints first

tidb-lightning-ctl --checkpoint-remove=all执行该命令后
再导入其他数据就可以了,但是日志里最后还是会报错

您好,这个报错可以参考下这个 issue invalid data file, miss host table · Issue #263 · pingcap/tidb-lightning · GitHub

好的,我知道了

:call_me_hand: