一 问题描述
配置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)
三 解决办法
给表加上主键。