1.先安装2个MySQL 其实也就是复制一个MySQL master-slave)
2.修改端口号和安装地址(my.ini) 这里我们不使用默认端口3306 主要测试
MySQL5.1
[client]
port=3307
[MySQLd]
port=3307
basedir="E:/MySQL5.1/"
datadir="E:/MySQL5.1/Data/"
MySQL5.2
[client]
port=3308
[MySQLd]
port=3308
basedir="E:/MySQL5.2/"
datadir="E:/MySQL5.2/Data/"
MySQL5.1
[client]
port=3307
[MySQLd]
port=3307
basedir="E:/MySQL5.1/"
datadir="E:/MySQL5.1/Data/"
MySQL5.2
[client]
port=3308
[MySQLd]
port=3308
basedir="E:/MySQL5.2/"
datadir="E:/MySQL5.2/Data/"
3.在Master(MySQL5.1)的数据库中建立一个备份帐户,命令如下
GRANT REPLICATION SLAVE ON *.* TO 'slave'@'localhost' IDENTIFIED BY '123456';
GRANT REPLICATION SLAVE ON *.* TO 'slave'@'localhost' IDENTIFIED BY '123456';
2014-07-13 16:26:35