- 主节点创建账号
-- 更新初始账号
-- update mysql.user set password=password('ucloud.cn') where host='127.0.0.1' and user='root';
-- flush privileges;
-- 创建主从账号 192.168.179.1是从节点的IP
create user 'repl'@'10.93.123.15' identified by 'ucloud.cn';
grant replication slave on *.* to 'repl'@'192.168.179.1';
flush privileges;- 查看主节点信息
show master status;- 从节点配置主节点信息
change master to master_host='10.93.123.15',master_port=3306,master_user='repl',master_password='ucloud.cn',master_log_file='mysql-bin.000002',master_log_pos=2183;- 启动主备
start slave;- 查看结果
show slave status\G