Some forms of the FLUSH
statement
are not logged because they could cause problems if replicated
to a replica: FLUSH LOGS
and
FLUSH TABLES WITH READ LOCK
. For
a syntax example, see FLUSH Statement. The
FLUSH TABLES
,
ANALYZE TABLE
,
OPTIMIZE TABLE
, and
REPAIR TABLE
statements are
written to the binary log and thus replicated to replicas. This
is not normally a problem because these statements do not modify
table data.
However, this behavior can cause difficulties under certain
circumstances. If you replicate the privilege tables in the
mysql
database and update those tables
directly without using GRANT
, you
must issue a FLUSH PRIVILEGES
on
the replicas to put the new privileges into effect. In addition,
if you use FLUSH TABLES
when
renaming a MyISAM
table that is part of a
MERGE
table, you must issue
FLUSH TABLES
manually on the
replicas. These statements are written to the binary log unless
you specify NO_WRITE_TO_BINLOG
or its alias
LOCAL
.