• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

Excluding a table or database from MySQL replication

by admin

This post discusses how to use replication filters to ignore a table or a database in replication. MySQL both have replication filters that explicitly allows and excludes replication of a database or a table from replicating. In this case, you will need to use the filters that ignore. There are three replications filters that can be used to ignore one or more tables:

  • replicate-ignore-db
  • replicate-ignore-table
  • replicate-wild-ignore-table

Each of these options will be discussed below. Shared for all of them are that they take exactly one argument, but you can specify the same option multiple times as needed.

Note: If you use a combination of replication filters, be sure to study the rules of evaluation.

replicate-ignore-db

In statements-based replication, replicate-ignore-db ignores statements having the default database as the database being ignored. In row-based replication, all tables in the specified database are ignored.

replicate-ignore-table

This option ignores the one table specified.

replicate-wild-ignore-table

This is the most flexible option. All tables matching the expression will be ignored. For example:

  • replicate-wild-ignore-table = foo.% : ignores all tables in the foo database
  • replicate-wild-ignore-table = foo.b% : ignores all tables in the foo database prefixed with b
  • replicate-wild-ignore-table = foo%.bar% : does not replicate updates that use a table where the database name starts with foo and the table name starts with bar.

Filed Under: mysql

Some more articles you might also be interested in …

  1. How to Generate Unique IDs For MySQL Cluster Backups
  2. How to Rollback RPM Upgrade of the MySQL Server
  3. How To Purge Audit Logs in MySQL
  4. How to Restrict MySQL User Creation with Blank Password
  5. What is an Arbitrator in MySQL Cluster
  6. How to find the size of a MySQL database
  7. How to gather information on the MySQL 8 Roles and Privileges assigned to a user without using SHOW GRANTS
  8. MySQL Server 8.0 – How to create a REPLICATION SLAVE using MEB
  9. “Access denied for user ‘username’@’hostname’ (using password: YES)” – Error while connecting MySQL with PHP
  10. System Tuning for MySQL Server

You May Also Like

Primary Sidebar

Recent Posts

  • qsub Command Examples in Linux
  • qsub: command not found
  • qrcp Command Examples in Linux
  • qmrestore Command Examples in Linux

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright