How to do it...

Assume that you are setting up server3 as a slave of server1 and server2. You need to create traditional replication from server1 to server3 over a channel and from server2 to server3 over another channel. To ensure that data is consistent on the slave, make sure that different sets of databases are replicated or the application takes care of the conflicts.

Before you begin, take a backup from server1 and restore on server3; similarly take a backup from server2 and restore on server3, as described in Chapter 9, Replication.

  1. On server3, modify the replication repositories to TABLE from FILE. You can change it dynamically by running the following commands:
mysql> STOP SLAVE; //If slave is already runningmysql> SET GLOBAL master_info_repository ...

Get MySQL 8 Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.