手机版
你好,游客 登录 注册 搜索
背景:
阅读新闻

MySQL备份与AB复制

[日期:2012-07-01] 来源:Linux社区  作者:linuxkeep [字体:大 中 小]

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)

行了!双向同步完成!

linux
相关资讯       MYSQL备份 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款