java.langRuntimeException:Target column:__#alibaba_rds_row_id#__ not matched

一 问题描述

配置rds到mariadb同步,canal client日志报错:

 二 出错原因

该表没有建主键。AliSQL 针对用户没有建 PK 的表,默认添加一个隐含主键。示例:

mysql> show create table t\G
*************************** 1. row ***************************
       Table: t
Create Table: CREATE TABLE `t` (
  `id` int(11) DEFAULT NULL,
  `__#alibaba_rds_row_id#__` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'Implicit Primary Key by RDS',
  KEY `__#alibaba_rds_row_id#__` (`__#alibaba_rds_row_id#__`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
1 row in set (0.00 sec)

三 解决办法

给表加上主键。

--本篇文章参考了What's new | 阿里云 RDS for MySQL 8.0独家技术解读-阿里云开发者社区

猜你喜欢

转载自blog.csdn.net/yabignshi/article/details/121840952