Customizing Replication

You may want to have a setup that is different from the simple two-server setup described previously. There are a number of options that you can apply to either the master or the slave. This lesson does not cover every possibility, but it covers the most commonly used ones.

You may not want to replicate all the databases on the master. For example, some of your databases may not be worthy of replicating, or you may just want to reduce network traffic and only replicate what is critical.

MySQL lets you tell a master server to ignore logging updates on certain named databases. You do this by placing a line in the [mysqld] section of my.cnf, like this:

[mysqld]
...
binlog-ignore-db  = database_name
					

You will need to restart ...

Get Sams Teach Yourself MySQL in 21 Days, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.