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
Now we shall set up replication for two tables on
Here is the
[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
Lets look at it carefully.
This is to tell the slave the commands that it has to execute will be having the same server-id as its own.
To log only database
Let the slave know that whatever command is for
db1 it has to execute on
Note how the table in
db2 is replicated, as against the general thinking of db1.table1, MySQL could be using some buffered string and then evaluating the