[英]MySQL replication not updating slave
Trying to set up replication master - slave. 尝试设置复制主服务器-从属服务器。
Master my.cnf 掌握my.cnf
[mysqld]
bind-address = 0.0.0.0
port = 3306
server-id = 1
log-bin = /var/lib/mysql/mysql-bin
replicate-do-db = Test
Slave my.cnf 奴隶my.cnf
[mysqld]
log_output = "FILE"
general_log_file = /var/log/mysql/mysql.log
general_log = 1
log_bin = /var/log/mysql/mysql-bin.log
server-id = 2
relay-log = /var/lib/mysql/mysql-relay-bin
relay-log-index = /var/lib/mysql/mysql-relay-bin.index
replicate-do-db = Test
SHOW SLAVE STATUS shows 显示从状态
Slave_IO_Running: Yes
Slave_SQL_Running: Yes
In relay log i see query executed on master. 在中继日志中,我看到在主服务器上执行的查询。
And Read_Master_Log_Pos also updates. 并且Read_Master_Log_Pos也将更新。
But in general_log_file appear only 但仅在general_log_file中出现
130530 14:50:25 523 Query BEGIN
523 Query COMMIT /* implicit, from Xid_log_event */
And changes on master not executed on slave. 并且主服务器上的更改未在从属服务器上执行。 What i have missed?
我错过了什么?
This could be due to the following option: 这可能是由于以下选项:
replicate-do-db = Test
The replicate-do-db option can be very tricky and can sometimes behave in a manner that appears illogical . 复制-do-db选项可能非常棘手,有时表现为看起来不合逻辑 。
It will only replicate statements where the default ((that is, the one selected by USE) database is set. So in your example that would mean that this is replicated: 它只会复制设置了默认数据库(即USE选择的数据库)的语句。因此在您的示例中,这意味着将复制该语句:
use Test
; use Test
;
insert into myTable (column) values (value);
But this will not be replicated: 但这不会被复制:
insert into Test.myTable (column) values (value);
Try using the replicate-wild-do-table option instead: 尝试改用copy-wild-do-table选项:
replicate-wild-do-table=Test.%
Hopefully you will get some joy. 希望你会得到一些快乐。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.