[[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