解决MySQL Replication出错一例
Jun 07, 2016 pm 04:07 PM运行环境: 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 权限没有被用到。

Article chaud

Outils chauds Tags

Article chaud

Tags d'article chaud

Bloc-notes++7.3.1
Éditeur de code facile à utiliser et gratuit

SublimeText3 version chinoise
Version chinoise, très simple à utiliser

Envoyer Studio 13.0.1
Puissant environnement de développement intégré PHP

Dreamweaver CS6
Outils de développement Web visuel

SublimeText3 version Mac
Logiciel d'édition de code au niveau de Dieu (SublimeText3)

Sujets chauds

Compétences de traitement de structures de données volumineuses de PHP

Comment optimiser les performances des requêtes MySQL en PHP ?

Comment utiliser la sauvegarde et la restauration MySQL en PHP ?

Comment insérer des données dans une table MySQL en utilisant PHP ?

Quels sont les scénarios d'application des types d'énumération Java dans les bases de données ?

Comment corriger les erreurs mysql_native_password non chargé sur MySQL 8.4

Comment utiliser les procédures stockées MySQL en PHP ?

Comment créer une table MySQL en utilisant PHP ?
