grant replication slave on *.* to 'rpl'@'192.168.162.130'>
重启主服务器的MySQL /etc/init.d/mysqld restart
查看master信息: 进入MySQL show master status \G;
修改从库配置文件
vi /etc/my.cnf
重启从服务器MySQL,进入MySQL
指定主服务器IP等信息
change master to master_host='192.168.162.128 ',master_user='rpl',master_password='123456',master_log_file='mysql-bin.000001',master_log_pos=647;
启动slave :start slave;
查看slave状态:show slave status \G;
报错Last_IO_Error: Fatal error: The slave I/O thread stops because master and slave have equal MySQL server UUIDs; these UUIDs must be different for replication to work