Documentation Home
MySQL 5.7 Reference Manual
Related Documentation Download this Manual
PDF (US Ltr) - 35.3Mb
PDF (A4) - 35.5Mb
PDF (RPM) - 33.8Mb
EPUB - 8.6Mb
HTML Download (TGZ) - 8.4Mb
HTML Download (Zip) - 8.5Mb
HTML Download (RPM) - 7.3Mb
Eclipse Doc Plugin (TGZ) - 9.3Mb
Eclipse Doc Plugin (Zip) - 11.3Mb
Man Pages (TGZ) - 198.3Kb
Man Pages (Zip) - 302.2Kb
Info (Gzip) - 3.2Mb
Info (Zip) - 3.2Mb
Excerpts from this Manual

MySQL 5.7 Reference Manual  /  ...  /  Replication Relay and Status Logs

18.2.4 Replication Relay and Status Logs

During replication, a slave server creates several logs that hold the binary log events relayed from the master to the slave, and to record information about the current status and location within the relay log. There are three types of logs used in the process, listed here:

  • The relay log consists of the events read from the binary log of the master and written by the slave I/O thread. Events in the relay log are executed on the slave as part of the SQL thread.

  • The master info log contains status and current configuration information for the slave's connection to the master. This log holds information on the master host name, login credentials, and coordinates indicating how far the slave has read from the master's binary log.

    This log can be written to the mysql.slave_master_info table instead of a file, by starting the slave with --master-info-repository=TABLE.

  • The relay log info log holds status information about the execution point within the slave's relay log.

    This log can be written to the mysql.slave_relay_log_info table instead of a file by starting the slave with --relay-log-info-repository=TABLE.

Crash-safe replication.  In order for replication to be crash-safe when using tables for logging status and relay information, these tables must use a transactional storage engine, such as InnoDB. In MySQL 5.7 these tables are created using InnoDB.

Therefore, in order to guarantee crash safety on the slave, you must run the slave with --relay-log-recovery enabled, in addition to setting --relay-log-info-repository to TABLE.

In MySQL 5.7, a warning is given when mysqld is unable to initialize the replication logging tables, but the slave is allowed to continue starting. This situation is most likely to occur when upgrading from a version of MySQL that does not support slave logging tables to one in which they are supported.

In MySQL 5.7, execution of any statement requiring a write lock on either or both of the slave_master_info and slave_relay_log_info tables is disallowed while replication is ongoing, while statements that perform only reads are permitted at any time.


Do not attempt to update or insert rows in the slave_master_info or slave_relay_log_info table manually. Doing so can cause undefined behavior, and is not supported.

User Comments
Sign Up Login You must be logged in to post a comment.