Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

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.

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

2 Answers 2

up vote 2 down vote accepted

So I had some lunch and figured it out !

  replicate-do-table      = database2.table
  replicate-rewrite-db    = "database1->database2"
share|improve this answer
    
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
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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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