MySql__为用户赋于主从同步的权限
在配置Otter的时候报错:
CanalParseException: command : 'show master status' has an error!
经查询是同步账户没有权限。使用同步账户在MySql中执行 'show master status',出现以下错误。MySql中修改 同步账号的 权限,问题解决。
ERROR 1227 (42000): Access denied; you need (at least one of) the SUPER,REPLICATION CLIENT privilege(s) for this operation
- 赋予REPLICATION CLIENT权限给 otter 用户,'REPLICATION CLIENT' 使得用户可以使用 'SHOW MASTER STATUS' 和 'SHOW SLAVE STATUS' 命令,也就是说这个权限是用于授予账户监视Replication状况的权力。
grant REPLICATION CLIENT ON test_master.* TO otter@'%';
grant REPLICATION CLIENT ON test_master.* TO otter@'localhost';
grant REPLICATION CLIENT ON test_master.* TO otter@'127.0.0.1';
# 刷新权限
flush privileges;
- 赋予REPLICATION SLAVE权限给 otter 用户,'REPLICATION SLAVE' 则是一个必须而基本的权限,它直接授予slave服务器以该账户连接master后可以执行replicate操作的权利。
grant REPLICATION SLAVE ON test_master.* TO otter@'%';
grant REPLICATION SLAVE ON test_master.* TO otter@'localhost';
grant REPLICATION SLAVE ON test_master.* TO otter@'127.0.0.1';
# 刷新权限
flush privileges;
- 赋予 SUPER 权限给 otter 用户。
grant SUPER ON test_master.* TO otter@'%';
grant SUPER ON test_master.* TO otter@'localhost';
grant SUPER ON test_master.* TO otter@'127.0.0.1';
# 刷新权限
flush privileges;
、REPLICATION SLAVE(服务端)、SUPER(管理)
网友评论