luthfianto
luthfianto

Reputation: 1826

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

Upvotes: 1

Views: 1578

Answers (1)

alextru
alextru

Reputation: 449

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.

Upvotes: 4

Related Questions