0

我正在尝试在我的 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 并没有发生任何事情。任何帮助,将不胜感激。

4

1 回答 1

0

在主人:

SHOW MASTER STATUS;

输出是:

+------------------+----------+--------------+------------------+
| File             | Position | Binlog_Do_DB | Binlog_Ignore_DB |
+------------------+----------+--------------+------------------+
| mysql-bin.000001 |      107 | karbord_test |                  |
+------------------+----------+--------------+------------------+
1 row in set

在奴隶上:

STOP SLAVE;

CHANGE MASTER TO
MASTER_LOG_FILE='mysql-bin.000001',
MASTER_LOG_POS=107;

START SLAVE;
于 2012-07-17T08:37:52.737 回答