您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

解决MySQL Replication出错一例

2024/7/13 7:35:47发布18次查看
运行环境: os: redhat as4 master: mysql 4.0.23 slave : mysql 5.0.37 slave日志中报错信息如下: 060807 11:40:17 [error] while trying to obtain the list of slaves from the master 'xxx.xxx.xxx:3306', user 'rep' got the following error: 'access
运行环境:
os: redhat as4
master: mysql 4.0.23
slave : mysql 5.0.37
slave日志中报错信息如下:
060807 11:40:17 [error] while trying to obtain the list of
slaves from the master 'xxx.xxx.xxx:3306', user 'rep' got the
following error: 'access denied. you need the replication slave
privilege for this operation'
在master上,执行以下语句查看权限:
mysql>show grant for 'rep'@'192.168.0.2'\g
*************************** 1. row ***************************
grants for rep@192.168.0.2: grant select, replication slave on
*.* to 'rep'@'192.168.0.2' identified by password 'xxx'
已经授予了 replicaion slave 权限了,怎么还会报这个错呢?
通过查看手册和源码,才知道slave需要执行一个语句来更新slave列表:
show slave hosts;
而执行这个语句则需要 replicaion client 权限,因此才会报错。因此,只要重新给 'rep' 帐号加上 replicaion client 权限就可以了。
另外,在 mysql 4.0/4.1 等老版本中似乎不存在这样的问题,因为在这些版本中 replicaion client 权限没有被用到。
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product