mysql> grant all privileges on *.* to 'root'@'172.168.40.%' identified 'xxxxxxxxxx'; Query OK, 0 rows affected, 1 warning (0.00 sec)by mysql> grant replication slave on *.* to 'redhat'@'172.168.40.%' identified by 'xxxxxxxxx'; mysql> grant all on *.* to root@'172.25.40.%' identified by 'xxxxxxxx'; Query OK, 0 rows affected, 1 warning (0.38 sec) Slave(candidate master)端配置:
yum install perl-DBD-mysql -y rpm -ivh mha4mysql-node-0.56-0.el6.noarch.rpm 构建免密登陆 ssh-keygen ##生成密钥 ssh-copy-id 172.25.40.1 ##给另外两台 mysql 主机分发,这样可以免密连接 ssh-copy-id 172.25.40.3 mysql 主配置文件(/etc/my.cnf)配置。