This configuration method applies to Versions later than 5.1 and is successfully configured on 5.5 (for versions earlier than 5.1, see other configuration instructions)
Environment Description: MASTER: 192.168.1.200slave: 192.168.1.210
MySQL master configuration: Configure My. ini:
[Mysqld] # The TCP/IP Port the MySQL server will listen onport = 3306server-id = 200log-bin = mysql-binrelay-log = relay-binrelay-log-Index = relay-bin-Index
* After configuration, restart the MySQL Service of the master !!!
// ---------------------------------------------------- MySQL slave configuration: Configure My. ini:
[Mysqld] # The TCP/IP Port the MySQL server will listen onport = 3306server-id = 210replicate-do-db = test
* After configuration, restart the MySQL service of slave !!! //--------------------------------------------------
Log on to slave and run the following command:
Mysql> stop slave; mysql> change master to master_host = '2017. 168.1.200 ', master_user = 'root', master_password = '000000'; mysql> Start slave; mysql> show slave status \ G;
Check whether the two items are yes and yes is normal. Slave_io_running: yesslave_ SQL _running: Yes