Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.
Original topic: lightning恢复库报错中横线"-"问题
[TiDB Usage Environment] Production Environment
[TiDB Version] 6.5.0
[Reproduction Path] None
[Encountered Problem: Problem Phenomenon and Impact]
tidb lightning encountered error: [Lightning:Config:ErrInvalidConfig] parse filter failed: at :1: unexpected special character ‘-’
The database name contains “-”, not an underscore, so restoring the backup data results in an error.
[Resource Configuration] Go to TiDB Dashboard - Cluster Info - Hosts and take a screenshot of this page
[Attachment: Screenshot/Log/Monitoring]
Currently, the database name cannot be changed.
Either wrap the name with ‘m’.
Will it still report an error if you put it in quotes?
Find the corresponding file and modify the create statement inside, import it first, and then rename it at the end?
You made a mistake when parsing the toml configuration file, right? Check if it meets the toml format requirements, refer to: GitHub - toml-lang/toml: Tom's Obvious, Minimal Language
Use quotation marks to enclose the database name.
Use quotation marks to enclose the database name.
Pay attention to the version issue: I remember during testing, try to use the latest version. Both the DM tool and the TiDB version need to be consistent to avoid this error. I also encountered this error when using different versions.
I also think it’s better to wrap it with tidb-test
, note that it’s not single quotes.
Is this considered a BUG? It seems like there are other ways to bypass this.
If the backed-up table structure is not enclosed in ``, it is likely caused by the sql-mode. Check the sql-mode of the upstream MySQL.