数据库名带“-”的是不是不支持DM同步

为提高效率,提问时请提供以下信息,问题描述清晰可优先响应。

  • 【TiDB 版本】:
  • 【问题描述】:[“Error: DB: h3-supplier - Could not execute query: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘-supplier LIKE ‘t_supplier_cp_class_relation’’ at line 1”] [task=h3] [unit=dump] ,数据库名带“-”的是不是不支持

若提问为性能优化、故障排查类问题,请下载脚本运行。终端输出的打印结果,请务必全选并复制粘贴上传。

用反引号``引起来试一下。这部分和 mysql 使用习惯应该是一致的。

麻烦举个例给我下 black-white-list: instance: do-dbs: [“ApolloPortalDB”,“activiti”,“ds0”,“h3-basic-setting”,“h3-customer”,“h3-orgmanager”,“h3-price”,“h3-purchase”,“h3-stock”,“h3-store”,“h3-supplier”,“h3-ware”,“h3-warehouse”] # white list of upstream schemas needs to be replicated, regular expression (starts with ~) is supported

看下官网上的详细介绍

给这个文档没啥用,我直接用名字不行,用通配符也不行 [2019/11/26 16:38:00.605 +08:00] [INFO] [mydumper.go:158] [“Thread 1 connected using MySQL connection ID 387586”] [task=h3_tidb] [unit=dump] [2019/11/26 16:38:00.629 +08:00] [INFO] [mydumper.go:158] [“Thread 2 connected using MySQL connection ID 387587”] [task=h3_tidb] [unit=dump] [2019/11/26 16:38:00.651 +08:00] [INFO] [mydumper.go:158] [“Thread 3 connected using MySQL connection ID 387588”] [task=h3_tidb] [unit=dump] [2019/11/26 16:38:00.675 +08:00] [INFO] [mydumper.go:158] [“Thread 4 connected using MySQL connection ID 387589”] [task=h3_tidb] [unit=dump] [2019/11/26 16:38:00.681 +08:00] [ERROR] [mydumper.go:164] [“Error: DB: h3-warehouse - Could not execute query: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘-warehouse LIKE ‘t_warehouse_purchase_returns_order’’ at line 1”] [task=h3_tidb] [unit=dump] [2019/11/26 16:38:00.681 +08:00] [INFO] [mydumper.go:158] [“Non-InnoDB dump complete, unlocking tables”] [task=h3_tidb] [unit=dump] [2019/11/26 16:38:00.682 +08:00] [INFO] [mydumper.go:158] [“Thread 3 shutting down”] [task=h3_tidb] [unit=dump] [2019/11/26 16:38:00.682 +08:00] [INFO] [mydumper.go:158] [“Thread 1 shutting down”] [task=h3_tidb] [unit=dump] [2019/11/26 16:38:00.682 +08:00] [INFO] [mydumper.go:158] [“Thread 4 shutting down”] [task=h3_tidb] [unit=dump] [2019/11/26 16:38:00.682 +08:00] [INFO] [mydumper.go:158] [“Thread 2 shutting down”] [task=h3_tidb] [unit=dump] [2019/11/26 16:38:00.682 +08:00] [INFO] [mydumper.go:158] [“Finished dump at: 2019-11-26 16:38:00”] [task=h3_tidb] [unit=dump]

black-white-list: instance: do-dbs: [“h3-warehouse”]

1)正常使用下,库表名如果带中横线,需要用返引号引起来。

2)dm 配置上,尝试用`` 引起来,另外,如果报错可以再尝试用反斜杠转义。