MySQL Replication在Ubuntu Lucid Lynx Server上无法正常运行

我有两个Linux盒子.在master上是配置文件(my.cnf)

log-bin       = master-bin
log-bin-index = master-bin.index
binlog-do-db  = test_db
server-id     = 1

主人身份如下:

mysql> show master status;
+-------------------+----------+----------------+------------------+
| File              | Position | Binlog_Do_DB   | Binlog_Ignore_DB |
+-------------------+----------+----------------+------------------+
| master-bin.000026 |      106 | test_db        |                  |
+-------------------+----------+----------------+------------------+
1 row in set (0.00 sec)

slave上的配置文件是:

server-id = 2
relay-log-index = slave-relay-bin.index
relay-log   = slave-relay-bin
replicate-do-db=test_db

奴隶状态是:

mysql> show slave status\G
*************************** 1. row ***************************
               Slave_IO_State: Waiting for master to send event
                  Master_Host: 207.216.74.213
                  Master_User: repl_user
                  Master_Port: 3306
                Connect_Retry: 60
              Master_Log_File: master-bin.000027
          Read_Master_Log_Pos: 276
               Relay_Log_File: slave-relay-bin.000141
                Relay_Log_Pos: 422
        Relay_Master_Log_File: master-bin.000027
             Slave_IO_Running: Yes
            Slave_SQL_Running: Yes
              Replicate_Do_DB: test_db
                   Last_Errno: 0
          Exec_Master_Log_Pos: 276
              Relay_Log_Space: 723
              Until_Condition: None
                Until_Log_Pos: 0
           Master_SSL_Allowed: No
        Seconds_Behind_Master: 0
Master_SSL_Verify_Server_Cert: No
                Last_IO_Errno: 0
               Last_SQL_Errno: 0
1 row in set (0.00 sec)

我从上面的状态中删除了一些空条目

Slave确实连接并显示正确的主日志文件,但我没有从主服务器获取任何数据.

我唯一能找到的是master有版本5.1.41-3ubuntu12.10-log或MySQL但是slave有5.1.41-3ubuntu12.10.

版本或其他东西是否会产生问题?

解决方法:

:D是binlog_do_db.我删除它,现在它工作正常.

上一篇:mysql – 在没有停机的情况下将数据类型从mediumint更改为int


下一篇:Java零基础入门视频,大爆料!Github上100