谁能帮我解决windows中的主从复制(一步一步).I已经谷歌了它,但没有找到适当的配置(my.ini)为windows,它总是为LINUX。任何帮助我们都将不胜感激。
发布于 2016-05-30 20:18:55
步骤1)在主服务器上
停止主服务器,
设置server-id =1,
在my.ini中启用log-bin= mysql -bin,启动mysql服务器
2)在从机上
停止mysql服务器,
在my.ini中设置服务器id =2
启动mysql服务器
3)在主机上,使用从IP在主机上创建复制用户,如下所示
CREATE USER 'repli_user'@'slave_IP' IDENTIFIED BY 'password';
GRANT REPLICATION SLAVE ON *.* TO 'repli_user'@'slave_IP'; 4)转到Master
flush tables with read lock;
show master status;(请注意偏移文件编号和偏移位置)
unlock tables;5)在从机上
change master to
master_host = 'master_IP',
master_user = 'repli_user',
master_password= 'password',
master_log_file = 'mysql-bin.<file-number>',
master_log_pos = offset-pos;6)在从机上
start slave;
show slave status;备机状态应为等待主机发送事件;
https://stackoverflow.com/questions/37525236
复制相似问题