mysql互为主从复制详解----mysql-mm(6)
User: root
Host: localhost
db: NULL
Command: Query
Time: 0
State: NULL
Info: show processlist
*************************** 2. row ***************************
Id: 18
User: system user
Host:
db: NULL
Command: Connect
Time: 100
State: Waiting for master to send event
Info: NULL
*************************** 3. row ***************************
Id: 19
User: system user
Host:
db: NULL
Command: Connect
Time: 100
State: Has read all relay log; waiting for the slave I/O thread to update it
Info: NULL
*************************** 4. row ***************************
Id: 21
User: repl2
Host: 211.100.97.250:34536
db: NULL
Command: Binlog Dump
Time: 19
State: Has sent all binlog to slave; waiting for binlog to be updated
Info: NULL
4 rows in set (0.00 sec)
----------------------
同步两个数据库的基础库
----------------
解锁服务器
mysql> unlock tables;
----------------
mysql> use test;
mysql> show tables;
Empty set (0.00 sec)
----------------
mysql> create table t11_replicas
-> (id int not null auto_increment primary key,
-> str varchar(255) not null) engine myisam;
Query OK, 0 rows affected (0.00 sec)
mysql> insert into t11_replicas(str) values
-> ('This is a master to master test table');
Query OK, 1 row affected (0.00 sec)
----------------
mysql> show tables;
----------------
mysql> select * from t11_replicas;
------------------------------------------------------------------------------------------------
B:
mysql> show master status\G;
*************************** 1. row ***************************
File: mysql-bin.000014
Position: 98
Binlog_Do_DB: test
Binlog_Ignore_DB: mysql
1 row in set (0.00 sec)
----------------
mysql> stop slave;
mysql> change master to master_host='A_IP', master_user='repl2', master_password='123456', master_log_file='mysql-bin.000005',master_log_pos=106;
mysql> start slave;
----------------
mysql> show processlist\G;
*************************** 1. row ***************************
相关新闻>>
- 发表评论
-
- 最新评论 进入详细评论页>>