13

Our QA environment has all it's database names suffixed with "test". For example dbname1 in production would have a counterpart dbname1test in QA. (This is largely to help protect against prod/qa configs getting mixed up).

There are a handful of tables I would like to replicate the actual production tables into QA. I'm not sure how I would go about telling it to say "replicate from dbname1 there to dbname1test there"

Is this even possible?

19

Yes, there is. Put this in your my.cnf file:

replicate-rewrite-db="dbname1->dbname1test"

See Replication Slave Options and Variables: replicate-rewrite-db

  • 1
    Thank you, and my apologies for missing this in the docs. – atxdba Sep 17 '11 at 16:31

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.