The following tables list basic information about the MySQL command-line options and system variables applicable to replication and the binary log.
Table 16.3 Summary of Replication options and variables in MySQL 5.7
| Option or Variable Name | ||
|---|---|---|
| Command Line | System Variable | Status Variable |
| Option File | Scope | Dynamic |
| Notes | ||
| Yes | No | No |
| Yes | No | |
DESCRIPTION: Option used by mysql-test for debugging and testing of replication |
||
| Yes | Yes | No |
| Yes | Global | No |
DESCRIPTION: Controls how binary logs are iterated during GTID recovery |
||
| No | No | Yes |
| No | Both | No |
DESCRIPTION: Count of CHANGE MASTER TO statements |
||
| No | No | Yes |
| No | Both | No |
DESCRIPTION: Count of SHOW MASTER STATUS statements |
||
| No | No | Yes |
| No | Both | No |
DESCRIPTION: Count of SHOW NEW MASTER statements |
||
| No | No | Yes |
| No | Both | No |
DESCRIPTION: Count of SHOW SLAVE HOSTS statements |
||
| No | No | Yes |
| No | Both | No |
DESCRIPTION: Count of SHOW SLAVE STATUS statements |
||
| No | No | Yes |
| No | Both | No |
DESCRIPTION: Count of SHOW SLAVE STATUS NONBLOCKING statements |
||
| No | No | Yes |
| No | Both | No |
DESCRIPTION: Count of START SLAVE statements |
||
| No | No | Yes |
| No | Both | No |
DESCRIPTION: Count of STOP SLAVE statements |
||
| Yes | No | No |
| Yes | No | |
DESCRIPTION: Option used by mysql-test for debugging and testing of replication |
||
| Yes | Yes | No |
| Yes | Global | Yes |
DESCRIPTION: Prevents execution of statements that cannot be logged in a transactionally safe manner |
||
| Yes | Yes | No |
| Yes | Global | Yes |
DESCRIPTION: Prevents execution of statements that cannot be logged in a transactionally safe manner |
||
| Yes | No | No |
| Yes | No | |
DESCRIPTION: Deprecated and will be removed in a future version. Use the renamed gtid-executed-compression-period instead. |
||
| No | Yes | No |
| No | Global | Yes |
DESCRIPTION: Deprecated and will be removed in a future version. Use the renamed gtid_executed_compression_period instead. |
||
| Yes | No | No |
| Yes | No | |
DESCRIPTION: Compress gtid_executed table each time this many transactions have occurred. 0 means never compress this table. Applies only when binary logging is disabled. |
||
| Yes | Yes | No |
| Yes | Global | Yes |
DESCRIPTION: Controls whether GTID based logging is enabled and what type of transactions the logs can contain |
||
| No | Yes | No |
| No | Global | No |
DESCRIPTION: Global: All GTIDs in the binary log (global) or current transaction (session). Read-only. |
||
| No | Yes | No |
| No | Global | Yes |
DESCRIPTION: Compress gtid_executed table each time this many transactions have occurred. 0 means never compress this table. Applies only when binary logging is disabled. |
||
| No | Yes | No |
| No | Global | Yes |
DESCRIPTION: Controls whether GTID based logging is enabled and what type of transactions the logs can contain |
||
| No | Yes | No |
| No | Session | Yes |
DESCRIPTION: Specifies the GTID for the next statement to execute. See documentation for details. |
||
| No | Yes | No |
| No | Both | No |
DESCRIPTION: The set of GTIDs owned by this client (session), or by all clients, together with the thread ID of the owner (global). Read-only. |
||
| No | Yes | No |
| No | Global | Yes |
DESCRIPTION: The set of all GTIDs that have been purged from the binary log. |
||
| Yes | Yes | No |
| Yes | Global | Yes |
DESCRIPTION: Statements that are executed when a slave connects to a master |
||
| Yes | Yes | No |
| Yes | Global | No |
DESCRIPTION: Tells the slave to log the updates performed by its SQL thread to its own binary log |
||
| Yes | Yes | No |
| Yes | Global | No |
DESCRIPTION: Whether the slave should log the updates performed by its SQL thread to its own binary log. Read-only; set using the --log-slave-updates server option. |
||
| No | Yes | No |
| No | Global | Yes |
DESCRIPTION: Disables error 1592 warnings being written to the error log |
||
| Yes | No | No |
| Yes | No | |
DESCRIPTION: The location and name of the file that remembers the master and where the I/O replication thread is in the master's binary logs |
||
| Yes | No | No |
| Yes | No | |
DESCRIPTION: Whether to write master status information and replication I/O thread location in the master's binary logs to a file or table. |
||
| Yes | No | No |
| Yes | No | |
DESCRIPTION: Number of tries the slave makes to connect to the master before giving up |
||
| Yes | Yes | No |
| Yes | Global | Yes |
DESCRIPTION: Whether to write master status information and replication I/O thread location in the master's binary logs to a file or table |
||
| Yes | Yes | No |
| Yes | Global | No |
DESCRIPTION: The location and base name to use for relay logs |
||
| Yes | Yes | No |
| Yes | Global | No |
DESCRIPTION: The location and name to use for the file that keeps a list of the last relay logs |
||
| Yes | No | No |
| Yes | No | |
DESCRIPTION: The location and name of the file that remembers where the SQL replication thread is in the relay logs |
||
| Yes | No | No |
| Yes | No | |
DESCRIPTION: Whether to write the replication SQL thread's location in the relay logs to a file or a table. |
||
| Yes | No | No |
| Yes | No | |
DESCRIPTION: Enables automatic recovery of relay log files from master at startup |
||
| No | Yes | No |
| No | Global | No |
DESCRIPTION: Complete path to relay log, including filename |
||
| Yes | Yes | No |
| Yes | Global | No |
DESCRIPTION: The name of the relay log index file |
||
| Yes | Yes | No |
| Yes | Global | No |
DESCRIPTION: The name of the file in which the slave records information about the relay logs |
||
| No | Yes | No |
| No | Global | Yes |
DESCRIPTION: Whether to write the replication SQL thread's location in the relay logs to a file or a table |
||
| Yes | Yes | No |
| Yes | Global | Yes |
DESCRIPTION: Determines whether relay logs are purged |
||
| Yes | Yes | No |
| Yes | Global | Yes |
DESCRIPTION: Whether automatic recovery of relay log files from master at startup is enabled; must be enabled for a crash-safe slave. |
||
| Yes | Yes | No |
| Yes | Global | No |
DESCRIPTION: Maximum space to use for all relay logs |
||
| Yes | No | No |
| Yes | No | |
DESCRIPTION: Tells the slave SQL thread to restrict replication to the specified database |
||
| Yes | No | No |
| Yes | No | |
DESCRIPTION: Tells the slave SQL thread to restrict replication to the specified table |
||
| Yes | No | No |
| Yes | No | |
DESCRIPTION: Tells the slave SQL thread not to replicate to the specified database |
||
| Yes | No | No |
| Yes | No | |
DESCRIPTION: Tells the slave SQL thread not to replicate to the specified table |
||
| Yes | No | No |
| Yes | No | |
DESCRIPTION: Updates to a database with a different name than the original |
||
| Yes | No | No |
| Yes | No | |
DESCRIPTION: In replication, if set to 1, do not skip events having our server id |
||
| Yes | No | No |
| Yes | No | |
DESCRIPTION: Tells the slave thread to restrict replication to the tables that match the specified wildcard pattern |
||
| Yes | No | No |
| Yes | No | |
DESCRIPTION: Tells the slave thread not to replicate to the tables that match the given wildcard pattern |
||
| Yes | Yes | No |
| Yes | Global | No |
DESCRIPTION: Host name or IP of the slave to be reported to the master during slave registration |
||
| Yes | Yes | No |
| Yes | Global | No |
DESCRIPTION: An arbitrary password that the slave server should report to the master. Not the same as the password for the MySQL replication user account. |
||
| Yes | Yes | No |
| Yes | Global | No |
DESCRIPTION: Port for connecting to slave reported to the master during slave registration |
||
| Yes | Yes | No |
| Yes | Global | No |
DESCRIPTION: An arbitrary user name that a slave server should report to the master. Not the same as the name used with the MySQL replication user account. |
||
| No | No | Yes |
| No | Global | No |
DESCRIPTION: Number of semisynchronous slaves |
||
| No | Yes | No |
| No | Global | Yes |
DESCRIPTION: Whether semisynchronous replication is enabled on the master |
||
| No | No | Yes |
| No | Global | No |
DESCRIPTION: The average time the master waited for a slave reply |
||
| No | No | Yes |
| No | Global | No |
DESCRIPTION: The total time the master waited for slave replies |
||
| No | No | Yes |
| No | Global | No |
DESCRIPTION: The total number of times the master waited for slave replies |
||
| No | No | Yes |
| No | Global | No |
DESCRIPTION: Number of times the master turned off semisynchronous replication |
||
| No | No | Yes |
| No | Global | No |
DESCRIPTION: Number of commits not acknowledged successfully |
||
| No | No | Yes |
| No | Global | No |
DESCRIPTION: Whether semisynchronous replication is operational on the master |
||
| No | No | Yes |
| No | Global | No |
DESCRIPTION: Number of times the master failed when calling time functions |
||
| No | Yes | No |
| No | Global | Yes |
DESCRIPTION: Number of milliseconds to wait for slave acknowledgment |
||
| No | Yes | No |
| No | Global | Yes |
DESCRIPTION: The semisynchronous replication debug trace level on the master |
||
| No | No | Yes |
| No | Global | No |
DESCRIPTION: The average time the master waited for each transaction |
||
| No | No | Yes |
| No | Global | No |
DESCRIPTION: The total time the master waited for transactions |
||
| No | No | Yes |
| No | Global | No |
DESCRIPTION: The total number of times the master waited for transactions |
||
| No | Yes | No |
| No | Global | Yes |
DESCRIPTION: How many slave acknowledgments the master must receive per transaction before proceeding |
||
| No | Yes | No |
| No | Global | Yes |
DESCRIPTION: Whether master waits for timeout even with no slaves |
||
| No | Yes | No |
| No | Global | Yes |
DESCRIPTION: The wait point for slave transaction receipt acknowledgment |
||
| No | No | Yes |
| No | Global | No |
DESCRIPTION: The total number of times the master waited for an event with binary coordinates lower than events waited for previously |
||
| No | No | Yes |
| No | Global | No |
DESCRIPTION: Number of sessions currently waiting for slave replies |
||
| No | No | Yes |
| No | Global | No |
DESCRIPTION: Number of commits acknowledged successfully |
||
| No | Yes | No |
| No | Global | Yes |
DESCRIPTION: Whether semisynchronous replication is enabled on slave |
||
| No | No | Yes |
| No | Global | No |
DESCRIPTION: Whether semisynchronous replication is operational on slave |
||
| No | Yes | No |
| No | Global | Yes |
DESCRIPTION: The semisynchronous replication debug trace level on the slave |
||
| Yes | Yes | No |
| Yes | Global | Yes |
DESCRIPTION: Set the number of seconds that STOP SLAVE waits before timing out. |
||
| No | Yes | No |
| No | Global | No |
DESCRIPTION: The server's globally unique ID, automatically (re)generated at server start |
||
| Yes | No | No |
| Yes | No | |
DESCRIPTION: Show user name and password in SHOW SLAVE HOSTS on this master |
||
| Yes | Yes | No |
| Yes | Global | No |
DESCRIPTION: Controls how binary logs are iterated during GTID recovery |
||
| Yes | No | No |
| Yes | No | |
DESCRIPTION: If set, slave is not autostarted |
||
| Yes | No | No |
| Yes | No | |
DESCRIPTION: Maximum number of transactions processed by a multi-threaded slave before a checkpoint operation is called to update progress status. Not supported by NDB Cluster. |
||
| Yes | No | No |
| Yes | No | |
DESCRIPTION: Update progress status of multi-threaded slave and flush relay log info to disk after this number of milliseconds. Not supported by NDB Cluster. |
||
| Yes | Yes | No |
| Yes | Global | No |
DESCRIPTION: The location where the slave should put its temporary files when replicating a LOAD DATA INFILE statement |
||
| Yes | No | No |
| Yes | No | |
DESCRIPTION: Maximum size, in bytes, of a packet that can be sent from a replication master to a slave; overrides max_allowed_packet. |
||
| Yes | Yes | No |
| Yes | Global | Yes |
DESCRIPTION: Number of seconds to wait for more data from a master/slave connection before aborting the read |
||
| Yes | No | No |
| Yes | No | |
DESCRIPTION: Tells the slave to use database partioning (DATABASE) or timestamp information (LOGICAL_CLOCK) from the master to parallelize transactions. The default is DATABASE. |
||
| Yes | No | No |
| Yes | No | |
DESCRIPTION: Number of worker threads for executing events in parallel. Set to 0 (the default) to disable slave multi-threading. Not supported by NDB Cluster. |
||
| Yes | No | No |
| No | No | |
DESCRIPTION: Maximum size of slave worker queues holding events not yet applied. |
||
| Yes | No | No |
| Yes | No | |
DESCRIPTION: Determines search algorithms used for slave update batching. Any 2 or 3 from the list INDEX_SEARCH, TABLE_SCAN, HASH_SCAN; the default is TABLE_SCAN,INDEX_SCAN. |
||
| Yes | Yes | No |
| Yes | Global | No |
DESCRIPTION: Tells the slave thread to continue replication when a query returns an error from the provided list |
||
| Yes | Yes | No |
| Yes | Global | Yes |
DESCRIPTION: Maximum number of transactions processed by a multi-threaded slave before a checkpoint operation is called to update progress status. Not supported by NDB Cluster. |
||
| Yes | Yes | No |
| Yes | Global | Yes |
DESCRIPTION: Update progress status of multi-threaded slave and flush relay log info to disk after this number of milliseconds. Not supported by NDB Cluster. |
||
| Yes | Yes | No |
| Yes | Global | Yes |
DESCRIPTION: Use compression on master/slave protocol |
||
| Yes | Yes | No |
| Yes | Global | Yes |
DESCRIPTION: Allows for switching the slave thread between IDEMPOTENT mode (key and some other errors suppressed) and STRICT mode; STRICT mode is the default, except for NDB Cluster, where IDEMPOTENT is always used |
||
| No | No | Yes |
| No | Global | No |
DESCRIPTION: The slave's replication heartbeat interval, in seconds |
||
| No | Yes | No |
| No | Global | Yes |
DESCRIPTION: Maximum size, in bytes, of a packet that can be sent from a replication master to a slave; overrides max_allowed_packet. |
||
| No | No | Yes |
| No | Global | No |
DESCRIPTION: Number of temporary tables that the slave SQL thread currently has open |
||
| No | Yes | No |
| No | Global | Yes |
DESCRIPTION: Tells the slave to use database partioning (DATABASE) or information (LOGICAL_CLOCK) from master to parallelize transactions. The default is DATABASE. |
||
| Yes | Yes | No |
| No | Global | Yes |
DESCRIPTION: Number of worker threads for executing events in parallel. Set to 0 (the default) to disable slave multi-threading. Not supported by NDB Cluster. |
||
| No | Yes | No |
| No | Global | Yes |
DESCRIPTION: Maximum size of slave worker queues holding events not yet applied. |
||
| Yes | Yes | No |
| No | Global | Yes |
DESCRIPTION: Ensures that all commits by slave workers happen in the same order as on the master to maintain consistency when using parallel worker threads. |
||
| No | No | Yes |
| No | Global | No |
DESCRIPTION: The total number of times since startup that the replication slave SQL thread has retried transactions |
||
| No | Yes | No |
| No | Global | Yes |
DESCRIPTION: Determines search algorithms used for slave update batching. Any 2 or 3 from the list INDEX_SEARCH, TABLE_SCAN, HASH_SCAN; the default is TABLE_SCAN,INDEX_SCAN. |
||
| No | No | Yes |
| No | Global | No |
DESCRIPTION: The state of this server as a replication slave (slave I/O thread status) |
||
| Yes | Yes | No |
| Yes | Global | Yes |
DESCRIPTION: Number of times the slave SQL thread will retry a transaction in case it failed with a deadlock or elapsed lock wait timeout, before giving up and stopping |
||
| Yes | Yes | No |
| Yes | Global | No |
DESCRIPTION: Controls type conversion mode on replication slave. Value is a list of zero or more elements from the list: ALL_LOSSY, ALL_NON_LOSSY. Set to an empty string to disallow type conversions between master and slave. |
||
| No | Yes | No |
| No | Global | Yes |
DESCRIPTION: Number of events from the master that a slave server should skip. Not compatible with GTID replication. |
||
| Yes | Yes | No |
| Yes | Global | Yes |
DESCRIPTION: Synchronously flush binary log to disk after every #th event |
||
| Yes | Yes | No |
| Yes | Global | Yes |
DESCRIPTION: Synchronize master.info to disk after every #th event. |
||
| Yes | Yes | No |
| Yes | Global | Yes |
DESCRIPTION: Synchronize relay log to disk after every #th event. |
||
| Yes | Yes | No |
| Yes | Global | Yes |
DESCRIPTION: Synchronize relay.info file to disk after every #th event. |
||
Section 16.1.6.2, “Replication Master Options and Variables”, provides more detailed information about options and variables relating to replication master servers. For more information about options and variables relating to replication slaves, see Section 16.1.6.3, “Replication Slave Options and Variables”.
Table 16.4 Summary of Binary Logging options and variables in MySQL 5.7
| Option or Variable Name | ||
|---|---|---|
| Command Line | System Variable | Status Variable |
| Option File | Scope | Dynamic |
| Notes | ||
| Yes | No | No |
| Yes | No | |
DESCRIPTION: Enable/disable binary log checksums |
||
| Yes | No | No |
| Yes | No | |
DESCRIPTION: Limits binary logging to specific databases |
||
| Yes | Yes | No |
| Yes | Both | Yes |
DESCRIPTION: Specifies the format of the binary log |
||
| Yes | No | No |
| Yes | No | |
DESCRIPTION: Tells the master that updates to the given database should not be logged to the binary log |
||
| Yes | No | No |
| Yes | No | |
DESCRIPTION: Binary log max event size |
||
| Yes | No | No |
| Yes | No | |
DESCRIPTION: Enables logging of rows query log events when using row-based logging. Disabled by default. Do not enable when producing logs for pre-5.6.2 slaves/readers. |
||
| No | No | Yes |
| No | Global | No |
DESCRIPTION: Number of transactions that used a temporary file instead of the binary log cache |
||
| Yes | Yes | No |
| Yes | Global | Yes |
DESCRIPTION: Size of the cache to hold the SQL statements for the binary log during a transaction |
||
| No | No | Yes |
| No | Global | No |
DESCRIPTION: Number of transactions that used the temporary binary log cache |
||
| No | Yes | No |
| No | Global | Yes |
DESCRIPTION: Enable/disable binary log checksums |
||
| Yes | Yes | No |
| Yes | Both | Yes |
DESCRIPTION: Causes updates using statement format to nontransactional engines to be written directly to binary log. See documentation before using. |
||
| Yes | Yes | No |
| Yes | Both | Yes |
DESCRIPTION: Controls what happens when the server cannot write to the binary log. |
||
| Yes | Yes | No |
| Yes | Global | Yes |
DESCRIPTION: Sets the number of microseconds to wait before synchronizing transactions to disk. |
||
| Yes | Yes | No |
| Yes | Global | Yes |
DESCRIPTION: Sets the maximum number of transactions to wait for before aborting the current delay specified by binlog_group_commit_sync_delay. |
||
| No | Yes | No |
| No | Global | Yes |
DESCRIPTION: How long to read transactions before flushing to binary log |
||
| No | Yes | No |
| No | Global | Yes |
DESCRIPTION: Whether to commit in same order as writes to binary log |
||
| Yes | Yes | No |
| Yes | Both | Yes |
DESCRIPTION: Use full or minimal images when logging row changes. Allowed values are full, minimal, and noblob. |
||
| No | Yes | No |
| No | Both | Yes |
DESCRIPTION: When TRUE, enables logging of rows query log events in row-based logging mode. FALSE by default. Do not enable when producing logs for pre-5.6.2 replication slaves or other readers. |
||
| No | No | Yes |
| No | Global | No |
DESCRIPTION: Number of nontransactional statements that used a temporary file instead of the binary log statement cache |
||
| Yes | Yes | No |
| Yes | Global | Yes |
DESCRIPTION: Size of the cache to hold nontransactional statements for the binary log during a transaction |
||
| No | No | Yes |
| No | Global | No |
DESCRIPTION: Number of statements that used the temporary binary log statement cache |
||
| Yes | Yes | No |
| Yes | Both | Yes |
DESCRIPTION: Deprecated and will be removed in a future version. Use the renamed binlog_error_action instead. |
||
| No | No | Yes |
| No | Both | No |
DESCRIPTION: Count of SHOW BINLOG EVENTS statements |
||
| No | No | Yes |
| No | Both | No |
DESCRIPTION: Count of SHOW BINLOGS statements |
||
| Yes | Yes | No |
| Yes | Global | No |
DESCRIPTION: Use version 1 binary log row events |
||
| No | Yes | No |
| No | Global | No |
DESCRIPTION: Complete path to binary log, including filename |
||
| Yes | Yes | No |
| Yes | Global | No |
DESCRIPTION: Shows whether server is using version 1 binary log row events |
||
| Yes | No | No |
| Yes | No | |
DESCRIPTION: Cause master to examine checksums when reading from the binary log |
||
| No | Yes | No |
| No | Global | Yes |
DESCRIPTION: Cause master to read checksums from binary log. |
||
| Yes | No | No |
| Yes | No | |
DESCRIPTION: Option used by mysql-test for debugging and testing of replication |
||
| Yes | Yes | No |
| Yes | Global | Yes |
DESCRIPTION: Can be used to restrict the total size used to cache a multi-statement transaction |
||
| Yes | Yes | No |
| Yes | Global | Yes |
DESCRIPTION: Binary log will be rotated automatically when size exceeds this value |
||
| Yes | Yes | No |
| Yes | Global | Yes |
DESCRIPTION: Can be used to restrict the total size used to cache all nontransactional statements during a transaction |
||
| Yes | No | No |
| Yes | No | |
DESCRIPTION: Cause slave to examine checksums when reading from the relay log |
||
| No | Yes | No |
| No | Global | Yes |
DESCRIPTION: Cause slave to examine checksums when reading from relay log. |
||
| Yes | No | No |
| Yes | No | |
DESCRIPTION: Option used by mysql-test for debugging and testing of replication |
||
Section 16.1.6.4, “Binary Logging Options and Variables”, provides more detailed information about options and variables relating to binary logging. For additional general information about the binary log, see Section 5.4.4, “The Binary Log”.
For information about the
sql_log_bin and
sql_log_off variables, see
Section 5.1.5, “Server System Variables”.
For a table showing all command-line options, system and status variables used with mysqld, see Section 5.1.3, “Server Option and Variable Reference”.