使用 Wamp Server mysql 进行定时数据库复制进行主从复制
我正在尝试在 wamp 服务器上使用主从复制来复制我的数据库。我对 my.ini 文件进行了以下更改:
# Number of threads allowed inside the InnoDB kernel.The optimal value
# depends highly on the application, hardware as well as the OS
# scheduler properties. A too high value may lead to thread thrashing.
innodb_thread_concurrency=8
#Defining the directory for logs and database and the server id
log-bin=C:\wamp\logs\mysql-bin.log
binlog-do-db=bank
server-id=2
在主服务器上,我配置了此:
mysql> GRANT REPLICATION SLAVE
-> ON *.* TO 'root'@'slave_ip'
-> IDENTIFIED BY '';
在从服务器上,我配置了此:
mysql> CHANGE MASTER TO
-> MASTER_HOST='(master_ip)',
-> MASTER_PORT=3306,
-> MASTER_USER='root',
-> MASTER_PASSWORD='';
我收到错误: 错误 1198:无法对正在运行的从服务器执行此操作;首先运行停止从站。
所以我跑了 stop Slave 并没有发生任何事情。任何帮助将不胜感激。
I am trying to replicate my database using master slave replication on my wamp server. I have made the following changes to my my.ini file:
# Number of threads allowed inside the InnoDB kernel.The optimal value
# depends highly on the application, hardware as well as the OS
# scheduler properties. A too high value may lead to thread thrashing.
innodb_thread_concurrency=8
#Defining the directory for logs and database and the server id
log-bin=C:\wamp\logs\mysql-bin.log
binlog-do-db=bank
server-id=2
On Master Server I configured this:
mysql> GRANT REPLICATION SLAVE
-> ON *.* TO 'root'@'slave_ip'
-> IDENTIFIED BY '';
On the slave server, I configured this:
mysql> CHANGE MASTER TO
-> MASTER_HOST='(master_ip)',
-> MASTER_PORT=3306,
-> MASTER_USER='root',
-> MASTER_PASSWORD='';
I got the error: Error 1198: This operation cannot be performed with a running slave; run stop slave first.
So I ran stop slave and nothing happened. Any help would be appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在主设备上:
SHOW MASTER STATUS;
输出为:
在从设备上:
on master:
SHOW MASTER STATUS;
output is :
on slave: