MySQL primary master replication (dual master replication) binlog-do-db

Source: Internet
Author: User

[[email protected] ~]# grep "binlog-do-db"/etc/my.cnf binlog-do-db = test[[email protected] ~]# grep "Binlog-do-db"/etc/ My.cnfbinlog-do-db=testbinlog-do-db=test2

db:mysql> use test2;database changedmysql> show tables; Empty Set (0.00 sec) mysql> db-s:mysql> show tables; Empty Set (0.04 sec) mysql> CREATE TABLE ' users ' (-id ' int ') not NULL auto_increment, ' name ' VA   Rchar (a) Not NULL, ' password ' varchar (+) NOT NULL, ' address ' varchar (+) DEFAULT NULL, PRIMARY key (' id '), UNIQUE key ' name ' (' name '), Engine=myisam auto_increment=4 DEFAULT Charset=utf8 ; Query OK, 0 rows affected (0.06 sec) mysql> show tables;+-----------------+| tables_in_test2+-----------------+| Users |+-----------------+1 row in Set (0.00 sec) db:mysql> SHOW tables;+-----------------+| Tables_in_test2 |+-----------------+| Users |+-----------------+1 row in Set (0.00 sec) mysql> drop table users; Query OK, 0 rows Affected (0.00 sec) db-s:mysql> Show tables;+-----------------+| Tables_in_test2 |+-----------------+| Users | #因DB没指定test2, so changes will not change from the library Db-s +-----------------+1 Row in Set (0.00 sec) 

Note: my.cnf in the binlog-do-db= library name, when the library changes, the corresponding changes from the library, that is, the main from each of the two libraries to use this parameter to name the corresponding phase from the synchronization of the library, and to the main note if you want more than one library, but also have multiple binlog-do-db parameters

[[email protected] ~]# grep "binlog-do-db"/etc/my.cnfbinlog-do-db=testbinlog-do-db=test2[[email protected] ~]# grep " Binlog-do-db "/etc/my.cnf binlog-do-db = testbinlog-do-db = Test2

MySQL primary master replication (dual master replication) binlog-do-db

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.