2

I got database1 on server1 and database2 on server2.

Now I need to replicate a single table from database1 to database2

Now I thought that this would work:

  replicate-ignore-table  = %
  replicate-do-table      = table
  replicate-rewrite-db    = "database1->database2"

but this does not seem to work as mysql does not accept % symbol with replicate-ignore-table directive. any ideas ?

EDIT:

I have tried :

  replicate-ignore-table  = database1.%
  replicate-do-table      = database1.table
  replicate-rewrite-db    = "database1->database2"

Now mysql is starting, but table is not being replicated.

  • +1 for answering you own question with a bit of lunch time. – RolandoMySQLDBA Nov 24 '12 at 3:03
3

So I had some lunch and figured it out !

  replicate-do-table      = database2.table
  replicate-rewrite-db    = "database1->database2"
  • I am glad to figured this one out yourself. I have something to share with you: replicate-ignore-table and replicate-do-table cannot be mixed any more than scotch and blood pressure meds. ( See my ServerFault post serverfault.com/a/271588/69271 under possibility #6 along with dev.mysql.com/doc/refman/5.1/en/… ) You get a +1 for removing replicate-ignore-table = database1.% to solve it. – RolandoMySQLDBA Nov 24 '12 at 3:02
0
replicate-ignore-table  = database1.%
replicate-do-table      = database1.table
replicate-rewrite-db    = "database1->database2"

due to what you configured and refer to MySQL docs, the mistake in your configuration is that, you are rewriting the db (which will done before any replication rule) 1->2, and then filtering replication on DB1.

check replication execution rules, flow chart.

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.