O'Reilly logo

MySQL 8 Cookbook by Karthik Appigatla

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required