1

There are options to dynamically set variables on replication slaves, like replicate_wild_do_table and replicate_wild_ignore_table. But, are there any options for replication master to dynamically set database names which begin with same prefix, and not repeating:

replicate-do-db=prefix_db1

replicate-do-db=prefix_other_db

replicate-do-db=prefix_third_database

...

in my.cnf.

1 Answer 1

1

Dynamically, no.

You could, however, write a SELECT against information_schema.TABLES to create the replicate-do-db list for subsequent manual (or programmatic) placement into the config file.

Are you really adding more databases frequently?

Would it be better to, instead, do replicate-ignore-db on the rest of the dbs?

Also, consider using binlog-... so that the filtering is done sooner (on the Master instead of on the Slave). (Yes, there are valid reasons to delay the filtering until the Slave.)

Your Answer

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

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