Database A's Host IP address is 192.168.239.131, database B's Host IP address is 192.168.239.1, the operating system is Windows XP, and the database name is TT
I,Database A requires the following settings:
Open the my. ini file and add several lines at the end (the directory specified by log-bin must exist ):
Server-id = 1
Log-bin = C :\mysqllog \ log-bin.log
BINLOG-do-DB = TT
Master-host = 192.168.239.131
Master-user = test
Masters-Password = 1234
Master-Port = 3306
Master-connect-retry = 60
Replicate-do-DB = TT
Log on to MYSQL as root and create a user logging on to machine B:
Grant replication slave, reload, super on *. * To test @ '192. 168.239.131 'identified by '2016 ';
II,Database B requires the following settings:
Open the my. ini file and add several lines at the end (the directory specified by log-bin must exist ):
Server-id = 2
Log-bin = C :\mysqllog \ log-bin.log
BINLOG-do-DB = TT
Master-host = 192.168.239.1
Master-user = test
Masters-Password = 1234
Master-Port = 3306
Master-connect-retry = 60
Replicate-do-DB = TT
Log on to MYSQL as the root user and create a user to log on to server:
Grant replication slave, reload, super on *. * To test @ '192. 168.239.1 'identified by '123 ';
Iii. Restart database A and database B
Iv. Database B execution
Slave start;
V. View status of A and B respectively
Mysql> show Master status;
6. Delete the master.info files of database A and database B respectively.