1, for convenience, I installed two MySQL instance under one windows, the port is 3306, 3307 respectively
Open the My.ini or my-default.ini file configuration Basedir datadir and port, default 3306. Configured as follows
Master Node
[ mysqld ] log-bin =mysql-bin// must ] = D:\developer\mysql-5.6.24 -win32datadir = D:\developer\mysql-5.6.24- win32\data# Port = ... server_id = =10//[ must server unique ID, default is 1, Generally take IP last paragraph sql_mode =no_engine_substitution,strict_trans_tables
From the node
[mysqld] log-bin=mysql-bin #[ not required ]== = 3307 Server-id=11 #[ must ] server unique ID, default is 1, generally take IP last paragraph sql_mode
To install the MySQL service, the command is as follows:
D:\developer\mysql-slave\bin\mysqld.exe install Mysql-slave--defaults-file= "d:\developer\mysql-slave\ My-default.ini "
Master MySQL server creates replication permissions for the user, and then restarts
Grant Replication on *. * to ' Repl '@ '%' by'qwert';
Show master status; The database is then not manipulated.
Slave server connection Master, the command is as follows:
Stop slave;
Change Master toMaster_host='127.0.0.1', Master_port=3306, Master_user='Repl', Master_password='Qwert', Master_log_file='mysql-bin.000001', Master_log_pos= 2388;
Start slave;
show slave status;
Problems that arise:
1, show master status; Show as empty the binary log is not turned on log-bin = ...
2, show slave status; Show Slave I/o: Error connecting to master ' [email protected]:3306 '-retry-time:60
Because the MySQL user of the master server has user = empty, delete from Mysql.user where user= ' and then reboot.
Resources:
1. Install multiple MySQL under Windows
2. mysql Master-slave replication
3. mysql Replication configuration http://www.cnblogs.com/northhurricane/p/3919889.html
4. Master-Slave standby (auto-sync) configuration for MySQL under Windows
MySQL master-slave master-slave synchronous replication configuration for read-write separation preparation