尝试设置复制主从。
掌握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
从 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 显示
Slave_IO_Running: Yes
Slave_SQL_Running: Yes
在中继日志中,我看到在主服务器上执行了查询。
并且 Read_Master_Log_Pos 也会更新。
但在general_log_file 只出现
130530 14:50:25 523 Query BEGIN
523 Query COMMIT /* implicit, from Xid_log_event */
并且主服务器上的更改未在从服务器上执行。我错过了什么?