赞
踩
vi /usr/local/mysql2/my.cnf
### 添加下面内容
server_id = 2
### 保存退出
/etc/init.d/mysqld2 restart
####把备份的数据库还原到从数据中,这边做的目的是为了和主从数据库的数据初始状态一致。
/usr/local/mysql2/bin/mysql -e "create database testsql"
/usr/local/mysql2/bin/mysql testsql < /tmp/mysql.sql
/usr/local/mysql2/bin/mysql
mysql>stop slave;
mysql>change master to master_host='127.0.0.1',master_user=’repl’,master_port=3306,master_password='123456',master_log_file='master.000001',master_log_pos=646075;
mysql>start slave;
mysql>show slave status\G;
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。