任何人都可以帮我解决Windows中的主从复制问题(一步一步)。我用google搜索了它,但没有找到适合Windows的配置(my.ini),它总是用于LINUX。任何帮助将不胜感激
答案 0 :(得分:0)
步骤1)在主人
上在master上停止服务器,
设置server-id = 1,
在my.ini中启用log-bin = mysql-bin, 启动mysql服务器
2)关于奴隶
停止mysql服务器,
在my.ini中设置server-id = 2
启动mysql服务器
3)在主人身上 在master上使用slave IP创建复制用户,如下所示
CREATE USER 'repli_user'@'slave_IP' IDENTIFIED BY 'password';
GRANT REPLICATION SLAVE ON *.* TO 'repli_user'@'slave_IP';
4)转到主人
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;
你应该得到&#34;等待主人发送事件&#34;作为奴隶状态;