6、测试同步情况:看看一台电脑写入数据另一台会同步吗?
在192.168.0.95的MySQL数据库test中插入数据xiaoming;
mysql> use test;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> create table english;
ERROR 1113 (42000): A table must have at least 1 column
mysql> create table english(
-> name varchar(25) not null,
-> grade varchar(25) not null);
Query OK, 0 rows affected (0.07 sec)
mysql> show tables;
+----------------+
| Tables_in_test |
+----------------+
| english |
| grade |
+----------------+
2 rows in set (0.00 sec)
这里我们增加了表english,有两个键值name和grade;
好了我们到192.168.0.57(原master)上看看有没有同步上去吧:
[root@desktop57 ~]# mysql -uroot -pwestos
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| test |
+--------------------+
3 rows in set (0.00 sec)
mysql> use test;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> show tables;
+----------------+
| Tables_in_test |
+----------------+
| english |
| grade |
+----------------+
2 rows in set (0.00 sec)
行了!双向同步完成!
