6

I have a master slave setup both mysql 5.5, the setup is fine except that the slave won't Binary log to the standard mysql-binlog only to the relay logs. I fear this may be due to my lack of understanding on the matter but my ultimate goal is to setup another slave feeding off the current slave to then point the two together for a master-master relationship.

My problem is that although on the slave I can insert a record and the master replication position (on the slave) will change, it will not change as a result of slave activity on the same database. Will the slave not dump activity into both logs? If i point the secondary slave to relay logs what are my options down the line?

Hope that makes sense.

my my.ini setup on the slave is as such, a unique server id and hostname are also set:

binlog-do-db=our_database  
binlog-ignore-db=mysql  
binlog-ignore-db=test  
replicate-do-db=our_database  

1 Answer 1

6

You forgot one thing

binlog-do-db=our_database  
binlog-ignore-db=mysql  
binlog-ignore-db=test  
replicate-do-db=our_database  
log-slave-updates

The option log-slave-updates takes SQL that was read from relay logs and records them in the Slave Binary Logs when the SQL is completed.

Please be very careful. You should never use binlog-do-db and binlog-ignore-db simultaneously. I wrote about this back on Jun 14, 2012 ( Configured MySQL replication but its not working ) which points to an old Percona article on binlog-do-db being dangerous.

SUGGESTION

Of the things you are using, you only need these lines

replicate-do-db=our_database  
log-slave-updates

You really don't need binlog-do-db=our_database once you have log-slave-updates working properly.

2
  • You were exactly right, as soon as that flag went in everything started going. I've taken your advice and cleaned up the ini file also, thanks again. Commented Dec 5, 2012 at 10:05
  • @RolandoMySQLDBA If we don't need another slave to feed off this slave, we can switch off log-bin and log-slave-updates on the slave, correct?
    – kouton
    Commented Dec 13, 2014 at 6:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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