设置双机热备:
首先要在两台机器上建立同步用户:
grant replication slave on *.* to ‘repdcs‘@‘192.168.21.39‘ identified by ‘123456‘;
grant all privileges on *.* to ‘repdcs‘@‘192.168.21.39 identified by ‘123456‘;
FLUSH PRIVILEGES;
grant replication slave on *.* to ‘repdcs‘@‘192.168.21.106‘ identified by ‘123456‘;
grant all privileges on *.* to ‘repdcs‘@‘192.168.21.106 identified by ‘123456‘;
FLUSH PRIVILEGES;
report-host=db-slave.mycompany.com //报告错误的服务器
然后重启两个机器的数据库,基本就没问题了,大致步骤给主从差不多,可以参考我的博客 mysql主从的参数配置与步骤
原文地址:http://blog.csdn.net/lihaiwenshu/article/details/40439811