The same computer is configured mysql5.5 two instances, respectively, on 3310 and 33,112 ports. Set 3310 for the main library and 3311 for the slave library.
The final effect is as follows:
3310 Main Library:
Grant ReplicationSlave,reload,super on *.* toSlave@192.168.1. theIdentified by '123456';
--added under [mysqld] in the My.ini fileServer-Id= 1Replicate-Do-Db=Test1
3311 from the library:
-- My.ini file [mysqld] add server- ID = 2 replicate - do- db= test1relay - Log = relay- binrelay - log - index = relay- Bin - index
Stop slave;
--"Method One"
Change Master toMaster_host='192.168.1.110', Master_port=3310, Master_user='slave', Master_password='123456';--"Method Two" if you specify position synchronization, use (the following two parameters through the main Library command "show master status;"view):
Change Master toMaster_host='192.168.1.110', Master_port=3310, Master_user='slave', Master_password='123456',
Master_log_file='mysql-bin.000001', Master_log_pos=107;
Start slave;
At this point, the configuration is complete by command:
show slave status\g;
To see if the synchronization is successful, the key metrics are:
Slave_IO_Running:YesSlave_SQL_Running:Yes
Note:
-- View server_id: like ' server_id ';
-- View host status on the primary server, file and positionshow Master State;
The default configuration of the root account in MySQL does not have a password, modified by the following ways:
- - penter Password: (direct carriage return here)
-- Change Password to 123456 set Password=password ('123456'); -- Refresh Permissions privileges;
Attached my.ini configuration file Download:
My.ini Download
Reference:
Https://www.cnblogs.com/puchengjie/p/5220676.html
Master-Slave synchronization failure Solution:
Slave_sql_running:no
http://blog.51cto.com/kerry/277414
Http://blog.chinaunix.net/uid-21505614-id-289477.html
Linux under Configuration Master-slave reference:
Http://blog.chinaunix.net/uid-21505614-id-289477.html
MySQL implementation of master-Slave synchronization in Window environment