DM 从 polardb 向 TiDB 迁移初始化报错

 "RawCause": "sql: SELECT `EVENT_SCHEMA`,`EVENT_NAME`,`TIME_ZONE`,`LAST_EXECUTED`,`EXECUTE_AT`,`STARTS`,`ENDS`,`INTERVAL_VALUE`,`INTERVAL_FIELD`,`ON_COMPLETION`,`STATUS`,`ORIGINATOR` FROM `information_schema`.`EVENTS_QUEUE` LIMIT 1: Error 1227: Access denied; you need (at least one of) the SUPER privilege(s) for this operation",

迁移账号权限给够了么,看报错是没有权限

拿不到这些权限,能绕过吗?

replication slave ,replication client这些应该能拿到吧。polardb应该没有限制啊,拿不到是什么限制

这里提示的是要 super 权限。至于你说的 replication slave replication client 这些都有。
就是不明白为什么DM 开始要去执行下

SELECT `EVENT_SCHEMA`,`EVENT_NAME`,`TIME_ZONE`,`LAST_EXECUTED`,`EXECUTE_AT`,`STARTS`,`ENDS`,`INTERVAL_VALUE`,`INTERVAL_FIELD`,`ON_COMPLETION`,`STATUS`,`ORIGINATOR` FROM `information_schema`.`EVENTS_QUEUE` LIMIT 1

这样的sql,这个sql要super权限。

你show grants看下账号权限,replication slave,replication client,这两个本身就是super权限,你是不是有同名账号,ip段不同的情况

很奇怪,这就是超级权限了,你这个账号就一个么,你直接show grants;不加后面的for那些,结果也是一样的么

就一个账号,这个是 polardb,不是标准的mysql。我看网上搜到过成功迁移的例子,不知道是不是我哪里配置的不对。第一步就错了。

知道是polardb,确实是可以的,可能是你这个版本太低了吧,dm的版本是多少,还有polardb的版本

看着好像没有super权限,给一下试试呢

DM 是 8.5.1 polardb 是 5.7

dm的配置文件也脱敏发一下吧,还是dm日志里的详细报错

测试的例子,帮忙看看怎么改改能同步。

# Task
name: tiup-playground-task6
task-mode: "all"              # Execute all phases - full data migration and incremental sync.
ignore-checking-items: ["all"]

# Source (MySQL)
mysql-instances:
  - source-id: "polardb-01"
    mydumper-config-name: "global"
    route-rules: ["route-rule-1"]
    filter-rules: ["filter-rule-1"]
mydumpers:
  global:
    extra-args: "--consistency none"
filters:
  filter-rule-1:
    schema-pattern: "test"
    table-pattern: "*"
    events: ["all dml","all ddl"]
    action: Do
routes:
   route-rule-1:
     schema-pattern: "test"
     table-pattern: "*"
     target-schema: "test"
## Target (TiDB)
target-database:
  host: "127.0.0.1"
  port: 4000
  user: "root"
  password: ""                # If the password is not empty, it is recommended to use a password encrypted with dmctl.

filters中的events去掉看看有没有效果,能起来不,https://docs.pingcap.com/zh/tidb/v6.5/task-configuration-file-full,你按照官方的写一下,你这个给的比较简化,看不太出来,按理说超级权限也应该是增量时候要的

搞了个增量的试了试。报错:

感觉同步不了。实际表结构也是源端同步过来的,但是解析binlog的时候,values还是多一列。

这个问题是已知问题,你这个表没有主键吧,阿里云对没有主键的表会给个隐式主键,你同步一个有主键的表

1 个赞


用这个可以

那剩下两个问题:

  1. 全量那个怎么才能不报错?
  2. 不带主键的表怎么搞下让能同步过来?隐藏主键是啥名字?我下游给建一个也可以。

1.你用dumpling备份下,正常应该是不会报错的,如果dumpling报错就有问题了
2.隐藏主键可以看下polardb官网文章:迁移本地MySQL至PolarDB MySQL_云原生数据库 PolarDB(PolarDB)-阿里云帮助中心

1 个赞

权限先给最大的,排除权限问题。