MySQL Replication – Same Server Different Databases Setup

MySQLmysql-5.6mysqladminreplicationwindows

What I have :

  • a windows machine with one instance of MySQL 5.6 Server.
  • two database named test and test2.
  • Test database has a table called activity with columns id and class

What I need :

  • replication of test.activity table to test2 database with a condition that Test.activity.class = 'B'.

I know how to replicate with in different server. But not for same server within different database.I have checked this link , but it does not give enough information.

Best Answer

That wouldn't be a normal situation at all! You can't alter the database during replication, and the master / slave cannot have the same server ids. I'd recommend if you must do this, then set up some triggers on the first DB, to replicate the insert / update commands against the second one.