Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MySQL同步到MySQL修改库名,canal-adapter如何配置dbMapping #5216

Open
sgjr opened this issue Jul 23, 2024 · 3 comments
Open

MySQL同步到MySQL修改库名,canal-adapter如何配置dbMapping #5216

sgjr opened this issue Jul 23, 2024 · 3 comments

Comments

@sgjr
Copy link

sgjr commented Jul 23, 2024

Question

canal版本

1.1.7

问题描述

  • 想要增量同步test0718库的数据到改名的库test0723中,如何写dbMapping配置, 目前只要指定表名才能正常同步,配置如下:
concurrent: true
dataSourceKey: demoSyncDS
destination: test-1721045534
groupId: g1
outerAdapterKey: mysql0
dbMapping:
  commitBatch: 3000
  database: test0718
  targetDb: test0723
  table: t1
  targetTable: t1
  mapAll: true
  targetPk:
    id: id

  • 尝试了以下好几种配置都不行,以下是错误配置

错误配置1:

concurrent: true
dataSourceKey: demoSyncDS
destination: test-1721045534
groupId: g1
outerAdapterKey: mysql0
dbMapping:
  commitBatch: 3000
  database: test0718
  targetDb: test0723

错误配置2

concurrent: true
dataSourceKey: demoSyncDS
destination: test-1721045534
groupId: g1
outerAdapterKey: mysql0
dbMapping:
  commitBatch: 3000
  database: test0718
  targetDb: test0723
  table: *
  targetTable: *
@xiaobai1017
Copy link

建议用mirror模式,数据库也同名

@jiugem
Copy link

jiugem commented Aug 7, 2024

@xiaobai1017 多对1的场景、用途不一样经常是不同库名

@dantanqikun
Copy link

目前是全库映射配置后,只能映射schema, 但数据同步不了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants