简体   繁体   中英

Replicate only some table (replicate-do-table) on Cloud SQL (MySQL)

So I have created a Cloud SQL (MySQL) DB somedb and its read replica somedb-replica , how can I replicate only some of its table (like replicate-do-table )?

I want to do

replicate-do-table=somedb.table1
replicate-do-table=somedb.table2

I'm afraid this is not possible, at least in the way you propose. To apply replication filters to a read replica, you would need to either pass the --replicate-do-table=somedb.sometbl flag when starting the replica instance, or connect to the instance later and issue the command CHANGE REPLICATION FILTER REPLICATE_DO_TABLE = somedb.sometbl (available from MySQL 5.7).

  1. Now, regarding the first option, this page of the CloudSQL docs lists all the flags with which you can start a Cloud SQL MySQL instance. So far, you can't set the replicate-do-table option, so the first option is unfeasible.
  2. And for the second option, you need SUPER privileges . In CLoudSQL, not even the root user has SUPER privileges . So this option is unfeasible as well.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM