标签:ted 1.5 oss 状态 binlog sha osi text start
主从复制实验环境:主从前提:主从数据库的数据需一致
[root@db01 ~]# mysqldump -uroot -p123 -A >/tmp/mysql.sql
[root@db01 ~]# scp /tmp/mysql.sql 172.16.1.52:/tmp
[root@db01 ~]# mysql -uroot -p123
mysql> show master status;
+------------------+----------+--------------+------------------+-------------------+
| File | Position | Binlog_Do_DB | Binlog_Ignore_DB | Executed_Gtid_Set |
+------------------+----------+--------------+------------------+-------------------+
| mysql-bin.000004 | 1180 | | | |
+------------------+----------+--------------+------------------+-------------------+
1 row in set (0.00 sec)
##创建slave用户
Db02操作
[root@db02 ~]# mysql -uroot -p123
mysql> source /tmp/mysql.sql; #导入db01上的数据库的数据
mysql> change master to
master_host=‘10.0.0.51‘,
master_user=‘slave‘,
master_password=‘123‘,
master_log_file=‘mysql-bin.000004‘,
master_log_pos=1180;
mysql> start slave; #开启从库
mysql> show slave status\G; #查看从库状态
标签:ted 1.5 oss 状态 binlog sha osi text start
原文地址:http://blog.51cto.com/13523963/2346689