文档首页/ 云数据库 TaurusDB/ 故障排除/ 备份恢复/ canal工具报错权限不足
更新时间:2024-11-29 GMT+08:00
分享

canal工具报错权限不足

场景描述

在搭建canal环境,使用指定用户从TaurusDB获取Binlog时,启动canal经常会报如下错误:'show master status' has an error! Access denied: you need (at least one of) the SUPER, REPLICATION CLIENT privilege(s) for this operation

完整报错信息如下:

2021-01-10 23:58:32.964 [destination = evoicedc , address = /dbus-mysql:3306 , EventParser] ERROR com.alibaba.ot ter.canal.common.alarm.LogAlarmHandler - destination:evoicedc[com.alibaba.otter.canal.parse.exception.CanalParseEx ception: command : 'show master status' has an error! 
Caused by: java.io.IOException: ErrorPacket [errorNumber=1227, fieldCount=-1, message=Access denied; you need (at least one of) the SUPER, REPLICATION CLIENT privilege(s) for this operation, sqlState=42000, sqlStateMarker=#] with command: show master status at com.alibaba.otter.canal.parse.driver.mysql.MysqlQueryExecutor.query(MysqlQueryExecutor.java:61) 

原因分析

canal拉取Binlog时需要赋予REPLICATION SLAVE, REPLICATION CLIENT权限。

解决方案

使用管理员账户给相应用户授予REPLICATION SLAVE, REPLICATION CLIENT权限。

GRANT SELECT, REPLICATION SLAVE, REPLICATION CLIENT ON *.* TO ‘canal’@’%’;

FLUSH PRIVILEGES;

相关文档