Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • MariaDB Cookbook
  • Toc
  • feedback
MariaDB Cookbook

MariaDB Cookbook

By : Daniel Bartholomew
4.2 (9)
close
MariaDB Cookbook

MariaDB Cookbook

4.2 (9)
By: Daniel Bartholomew

Overview of this book

Table of Contents (20 chapters)
close
MariaDB Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Selectively skipping the replication of binlog events


Sometimes, we want to skip replicating certain events to our replication slave servers. MariaDB lets us do this dynamically.

Getting ready

For this recipe, we'll assume that we've set up replication as described in either the Setting up replication or Using multisource replication recipes earlier in this chapter. Pick a master server and a slave server to use. In this recipe, we'll call db01 as the master server and db03 as the slave server.

How to do it...

  1. On db01, launch the mysql command-line client and run the following command to turn on replication skipping:

    SET @@skip_replication=1;
    
  2. On db01, create an empty database:

    CREATE DATABASE w;
    
  3. On db03, run the following commands to turn off replication of skipped events:

    STOP SLAVE;
    SET GLOBAL REPLICATE_EVENTS_MARKED_FOR_SKIP = FILTER_ON_MASTER;
    START SLAVE;
    
  4. On db01, create another empty database:

    CREATE DATABASE wx;
    
  5. On db03, switch to filtering on the slave:

    STOP SLAVE;
    SET GLOBAL REPLICATE_EVENTS_MARKED_FOR_SKIP...

Unlock full access

Continue reading for free

A Packt free trial gives you instant online access to our library of over 7000 practical eBooks and videos, constantly updated with the latest in tech
bookmark search playlist font-size

Change the font size

margin-width

Change margin width

day-mode

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Delete Bookmark

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete