1. Unidirectional Replication
Mysql5.0 and later versions
Server (master ): # Uniquely identifies the server instance In The Community Of Replication Partners.
Server - ID = 1
Log - Bin = Mysql_bin
BINLOG - Do - DB = Test
And create an account for synchronization MySQL > Grant Replication Slave On * . *
-> To ' Repadmin ' @ ' 192.168.1.223 ' Identified By ' Repadmin ' ;
Client (slave ): Master - Host = 192.168 . 1.72
Master - User = Repadmin
Master - Password = Repadmin
Master - Port = 3306
Server - ID = 2
Master - Connect - Retry = 60
Replicate - Do - DB = Test
Note:
1. After changing my. ini, the files generated under the Data Directory: master.info, relay-log.info, if you want to change the my. ini file, delete the two files and restart.
2. When start slave; is enabled, the files generated under the Data Directory are 45494b7bb4b14e4-relay-bin.000047 and 45494b7bb4b14e4-relay-bin.index.
3. view the server and client status:Show slave status;
Show slave status \ G;
Show processlist;
Show processlist \ G;
Show Master status;
Show Master Status \ G;
Show processlist;
Show processlist \ G;
Show processlist \ G;