How to skip table data for replication in MySQL? I would like to create a table on the master, whose data are not replicated to the slave.

I'm temporarily inserting many millions of rows in this table a part of a batch job; the data in this table can be re-created on demand, hence do not need to be replicated on the (slower) slave.

I don't want to use TEMPORARY tables, as I ideally want to keep the table structure in the database (on the slave as well, so that I can reliably use it for backup recovery), and above all I want to be able to recover from the current state if the job exits for any reason, so the table data need to persist on the master if the job dies.

Ideally, I would like to be able to control the replicability of the table from the CREATE statement, to be able to control this from my normal SQL workflow.

Is this possible? If not, close alternatives are welcome.
Create a database.  Add binlog_ignore_database on the master to avoid even sending the data out (as opposed to sending it, then tossing on the slave, as with replicate_ignore_*)

Put all your not-to-be-replicated tables in that database.  Reference them via dbname.tblname.

Be aware of how replication filters:  In SBR, USE controls what to check for do/ignore filters.

There's a trick I did quite successfully:


Setup: RBR, extra db, binlog_ignore_db (as above)
Create tables in that db and load data into them
Processed those tables (only on the Master) -- normalization, cleansing, updating Summary Tables, etc
INSERT stuff from that db into replicated tables (in other dbs). -- This is the only step that was replicated.
And drop the tables in the ignored db.


The net effect was to do a lot of ETL stuff only on the Master, yet still get the end results onto the Slave.