2

I am getting no errors yet replication is not working. I wonder where I am going wrong?

My master status is

            File: mysql-bin.000002
        Position: 2006432
    Binlog_Do_DB: site3,site2
Binlog_Ignore_DB: 

My Slave Status is

*************************** 1. row ***************************
               Slave_IO_State: Waiting for master to send event
                  Master_Host: 104.131.119.241
                  Master_User: drupal
                  Master_Port: 3306
                Connect_Retry: 60
              Master_Log_File: mysql-bin.000002
          Read_Master_Log_Pos: 2006432
               Relay_Log_File: mysqld-relay-bin.000003
                Relay_Log_Pos: 2006577
        Relay_Master_Log_File: mysql-bin.000002
             Slave_IO_Running: Yes
            Slave_SQL_Running: Yes
              Replicate_Do_DB: site3,site2
          Replicate_Ignore_DB: 
           Replicate_Do_Table: 
       Replicate_Ignore_Table: 
      Replicate_Wild_Do_Table: 
  Replicate_Wild_Ignore_Table: 
                   Last_Errno: 0
                   Last_Error: 
                 Skip_Counter: 0
          Exec_Master_Log_Pos: 2006432
              Relay_Log_Space: 2006879
              Until_Condition: None
               Until_Log_File: 
                Until_Log_Pos: 0
           Master_SSL_Allowed: No
           Master_SSL_CA_File: 
           Master_SSL_CA_Path: 
              Master_SSL_Cert: 
            Master_SSL_Cipher: 
               Master_SSL_Key: 
        Seconds_Behind_Master: 0
Master_SSL_Verify_Server_Cert: No
                Last_IO_Errno: 0
                Last_IO_Error: 
               Last_SQL_Errno: 0
               Last_SQL_Error: 
1 row in set (0.00 sec)
1
  • Replicate_Do_DB and similar options do not work exactly the way most people assume. You need BINLOG_FORMAT=ROW on the master if you want this configuration to be stable, or better, just replicate everything. Change that option in my.cnf on the master and restart it, then see what results you observe. – Michael - sqlbot Aug 22 '16 at 17:07
3
USE site99;
INSERT INTO site2.mytable ...;

will not be replicated. This is because the USE controls replication, not the db.tbl syntax.

If this does not provide the answer, please provide an example of the code that fails, plus mysqldumpbinlog against both the Master's binlog and the Slave's relay_log. This should show whether or not the query made it that far.

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.