When setting up master/slave replication in Mysql, do you then need to ignore any tables in /etc/mysql/my.cnf
or should replicate_wild_ignore_table
be leaved out under normal circumstances?
This is what I'm doing…
my.cnf
replicate_wild_ignore_table = mysql.%,information_schema.%,phpmyadmin.%
Best Answer
Please change the directive to one of the following:
or
mysql database
No need to do mysql. Why? Doing
GRANT
andREVOKE
commands will bypassreplicate_wild_ignore_table=mysql.%
because the SQL does not explicitly mention mysql schema tables.This will get by
replicate_wild_ignore_table=mysql.%
:This will get caught by
replicate_wild_ignore_table=mysql.%
:If you want to keep
replicate_wild_ignore_table=mysql.%
, I suggest the following:This will prevent the SQL from being recorded in the master's binary logs. Consequently, all SQL executed in the DB Session after
SET sql_log_bin = 0;
will not replicate.information_schema database
As far as the information_schema database, mysqld uses it to monitor database metadata. Each is unique to the MySQL instance. They never replicate intrinsically because you have the option to keep different table on Master and Slave. If the
information_schema
was replicated, then creating replication schemes such aswould be impossible for Slaves to handle.
SUMMARY
Doing
or
should be all you need. Notwithstanding, make sure any SQL that prepends phpmyadmin to all it table names may still slide by if the default database is not
phpmyadmin
.