MySQL support same-server replication into another database, Its quite a weired requirement, but in reality weired is common.
Consider a server 192.168.5.70, which has 2
databases db1 and db2
Now we shall set up replication for two tables on
db1, ie. table1 and
table2.
Here is the my.cnf
[mysqld] server-id=1 #### Replication #### report-host=master-is-slave-host log-bin=192.168.5.70-binlog relay-log=192.168.5.70-relaylog replicate-same-server-id=1 binlog-do-db=db1 # Note.... On rewrite, the command is changed into buffer # so the replicate-do-db and replicate-do-table should have the # re-written db name. replicate-rewrite-db=db1->db2 replicate-do-table=db2.table1 replicate-do-table=db2.table2