This section describes the server options and system variables
that apply to slave replication servers. You can specify the
options either on the command
line or in an option
file. Many of the options can be set while the server is
running by using the CHANGE MASTER
TO statement. You can specify system variable values
using SET.
Server ID.
On the master and each slave, you must use the
server-id option to establish a
unique replication ID in the range from 1 to
232 – 1. “Unique”
means that each ID must be different from every other ID in use
by any other replication master or slave. Example
my.cnf file:
[mysqld] server-id=3
Startup options for replication slaves.
The following list describes startup options for controlling
replication slave servers. Many of these options can be set
while the server is running by using the
CHANGE MASTER TO statement.
Others, such as the --replicate-* options, can
be set only when the slave server starts. Replication-related
system variables are discussed later in this section.
Command-Line Format --abort-slave-event-count=#Option-File Format abort-slave-event-countPermitted Values Type numericDefault 0Min Value 0When this option is set to some positive integer
valueother than 0 (the default) it affects replication behavior as follows: After the slave SQL thread has started,valuelog events are permitted to be executed; after that, the slave SQL thread does not receive any more events, just as if the network connection from the master were cut. The slave thread continues to run, and the output fromSHOW SLAVE STATUSdisplaysYesin both theSlave_IO_Runningand theSlave_SQL_Runningcolumns, but no further events are read from the relay log.This option is used internally by the MySQL test suite for replication testing and debugging. It is not intended for use in a production setting.
--disconnect-slave-event-countCommand-Line Format --disconnect-slave-event-count=#Option-File Format disconnect-slave-event-countPermitted Values Type numericDefault 0This option is used internally by the MySQL test suite for replication testing and debugging.
Command-Line Format --log-slave-updatesOption-File Format log-slave-updatesOption Sets Variable Yes, log_slave_updatesVariable Name log_slave_updatesVariable Scope Global Dynamic Variable No Permitted Values Type booleanDefault FALSENormally, a slave does not log to its own binary log any updates that are received from a master server. This option tells the slave to log the updates performed by its SQL thread to its own binary log. For this option to have any effect, the slave must also be started with the
--log-binoption to enable binary logging. Prior to MySQL 5.5, the server would not start when using the--log-slave-updatesoption without also starting the server with the--log-binoption, and would fail with an error; in MySQL 5.5, only a warning is generated. (Bug#44663)--log-slave-updatesis used when you want to chain replication servers. For example, you might want to set up replication servers using this arrangement:A -> B -> C
Here,
Aserves as the master for the slaveB, andBserves as the master for the slaveC. For this to work,Bmust be both a master and a slave. You must start bothAandBwith--log-binto enable binary logging, andBwith the--log-slave-updatesoption so that updates received fromAare logged byBto its binary log.Command-Line Format --log-slow-slave-statementsOption-File Format log-slow-slave-statementsPermitted Values Type booleanDefault offWhen the slow query log is enabled, this option enables logging for queries that have taken more than
long_query_timeseconds to execute on the slave.Command-Line Format --log-warnings[=#]-W [#]Option-File Format log-warningsOption Sets Variable Yes, log_warningsVariable Name log_warningsVariable Scope Global, Session Dynamic Variable Yes Disabled by skip-log-warningsPermitted Values Platform Bit Size 64Type numericDefault 1Range 0-18446744073709547520This option causes a server to print more messages to the error log about what it is doing. With respect to replication, the server generates warnings that it succeeded in reconnecting after a network/connection failure, and informs you as to how each slave thread started. This option is enabled by default; to disable it, use
--skip-log-warnings. If the value is greater than 1, aborted connections are written to the error log, and access-denied errors for new connection attempts are written. See Section C.5.2.11, “Communication Errors and Aborted Connections”.Note that the effects of this option are not limited to replication. It produces warnings across a spectrum of server activities.
Command-Line Format --master-info-file=file_nameOption-File Format master-info-file=file_namePermitted Values Type file nameDefault master.infoThe name to use for the file in which the slave records information about the master. The default name is
master.infoin the data directory. For information about the format of this file, see Section 17.2.2.2, “The Slave Status Files”.Command-Line Format --master-retry-count=#Option-File Format master-retry-countPermitted Values Platform Bit Size 32Type numericDefault 86400Range 0-4294967295Permitted Values Platform Bit Size 64Type numericDefault 86400Range 0-18446744073709551615The number of times that the slave tries to connect to the master before giving up. Reconnects are attempted at intervals set by the
MASTER_CONNECT_RETRYoption of theCHANGE MASTER TOstatement (default 60). Reconnects are triggered when data reads by the slave time out according to the--slave-net-timeoutoption. The default value is 86400. A value of 0 means “infinite”; the slave attempts to connect forever.The size at which the server rotates relay log files automatically. For more information, see Section 17.2.2, “Replication Relay and Status Files”. The default size is 1GB.
Cause the slave to permit no updates except from slave threads or from users having the
SUPERprivilege. On a slave server, this can be useful to ensure that the slave accepts updates only from its master server and not from clients. This variable does not apply toTEMPORARYtables.The basename for the relay log. The default basename is
. The server writes the file in the data directory unless the basename is given with a leading absolute path name to specify a different directory. The server creates relay log files in sequence by adding a numeric suffix to the basename.host_name-relay-binDue to the manner in which MySQL parses server options, if you specify this option, you must supply a value; the default basename is used only if the option is not actually specified. If you use the
--relay-logoption without specifying a value, unexpected behavior is likely to result; this behavior depends on the other options used, the order in which they are specified, and whether they are specified on the command line or in an option file. For more information about how MySQL handles server options, see Section 4.2.3, “Specifying Program Options”.If you specify this option, the value specified is also used as the basename for the relay log index file. You can override this behavior by specifying a different relay log index file basename using the
--relay-log-indexoption.You may find the
--relay-logoption useful in performing the following tasks:Creating relay logs whose names are independent of host names.
If you need to put the relay logs in some area other than the data directory because your relay logs tend to be very large and you do not want to decrease
max_relay_log_size.To increase speed by using load-balancing between disks.
The name to use for the relay log index file. The default name is
in the data directory, wherehost_name-relay-bin.indexhost_nameis the name of the slave server.Due to the manner in which MySQL parses server options, if you specify this option, you must supply a value; the default basename is used only if the option is not actually specified. If you use the
--relay-log-indexoption without specifying a value, unexpected behavior is likely to result; this behavior depends on the other options used, the order in which they are specified, and whether they are specified on the command line or in an option file. For more information about how MySQL handles server options, see Section 4.2.3, “Specifying Program Options”.If you specify this option, the value specified is also used as the basename for the relay logs. You can override this behavior by specifying a different relay log file basename using the
--relay-logoption.--relay-log-info-file=file_nameThe name to use for the file in which the slave records information about the relay logs. The default name is
relay-log.infoin the data directory. For information about the format of this file, see Section 17.2.2.2, “The Slave Status Files”.Disable or enable automatic purging of relay logs as soon as they are no longer needed. The default value is 1 (enabled). This is a global variable that can be changed dynamically with
SET GLOBAL relay_log_purge =.NEnables automatic relay log recovery immediately following server startup, which means that the replication slave discards all unprocessed relay logs and retrieves them from the replication master. This should be used following a crash on the replication slave to ensure that no possibly corrupted relay logs are processed. The default value is 0 (disabled).
This option places an upper limit on the total size in bytes of all relay logs on the slave. A value of 0 means “no limit.” This is useful for a slave server host that has limited disk space. When the limit is reached, the I/O thread stops reading binary log events from the master server until the SQL thread has caught up and deleted some unused relay logs. Note that this limit is not absolute: There are cases where the SQL thread needs more events before it can delete relay logs. In that case, the I/O thread exceeds the limit until it becomes possible for the SQL thread to delete some relay logs because not doing so would cause a deadlock. You should not set
--relay-log-space-limitto less than twice the value of--max-relay-log-size(or--max-binlog-sizeif--max-relay-log-sizeis 0). In that case, there is a chance that the I/O thread waits for free space because--relay-log-space-limitis exceeded, but the SQL thread has no relay log to purge and is unable to satisfy the I/O thread. This forces the I/O thread to ignore--relay-log-space-limittemporarily.The effects of this option depend on whether statement-based or row-based replication is in use.
Statement-based replication. Tell the slave SQL thread to restrict replication to statements where the default database (that is, the one selected by
USE) isdb_name. To specify more than one database, use this option multiple times, once for each database; however, doing so does not replicate cross-database statements such asUPDATEwhile a different database (or no database) is selected.some_db.some_tableSET foo='bar'WarningTo specify multiple databases you must use multiple instances of this option. Because database names can contain commas, if you supply a comma separated list then the list will be treated as the name of a single database.
An example of what does not work as you might expect when using statement-based replication: If the slave is started with
--replicate-do-db=salesand you issue the following statements on the master, theUPDATEstatement is not replicated:USE prices; UPDATE sales.january SET amount=amount+1000;
The main reason for this “check just the default database” behavior is that it is difficult from the statement alone to know whether it should be replicated (for example, if you are using multiple-table
DELETEstatements or multiple-tableUPDATEstatements that act across multiple databases). It is also faster to check only the default database rather than all databases if there is no need.Row-based replication. Tells the slave SQL thread to restrict replication to database
db_name. Only tables belonging todb_nameare changed; the current database has no effect on this. Suppose that the slave is started with--replicate-do-db=salesand row-based replication is in effect, and then the following statements are run on the master:USE prices; UPDATE sales.february SET amount=amount+100;
The
februarytable in thesalesdatabase on the slave is changed in accordance with theUPDATEstatement; this occurs whether or not theUSEstatement was issued. However, issuing the following statements on the master has no effect on the slave when using row-based replication and--replicate-do-db=sales:USE prices; UPDATE prices.march SET amount=amount-25;
Even if the statement
USE priceswere changed toUSE sales, theUPDATEstatement's effects would still not be replicated.Another important difference in how
--replicate-do-dbis handled in statement-based replication as opposed to row-based replication occurs with regard to statements that refer to multiple databases. Suppose that the slave is started with--replicate-do-db=db1, and the following statements are executed on the master:USE db1; UPDATE db1.table1 SET col1 = 10, db2.table2 SET col2 = 20;
If you are using statement-based replication, then both tables are updated on the slave. However, when using row-based replication, only
table1is affected on the slave; sincetable2is in a different database,table2on the slave is not changed by theUPDATE. Now suppose that, instead of theUSE db1statement, aUSE db4statement had been used:USE db4; UPDATE db1.table1 SET col1 = 10, db2.table2 SET col2 = 20;
In this case, the
UPDATEstatement would have no effect on the slave when using statement-based replication. However, if you are using row-based replication, theUPDATEwould changetable1on the slave, but nottable2—in other words, only tables in the database named by--replicate-do-dbare changed, and the choice of default database has no effect on this behavior.If you need cross-database updates to work, use
--replicate-wild-do-table=instead. See Section 17.2.3, “How Servers Evaluate Replication Filtering Rules”.db_name.%NoteThis option affects replication in the same manner that
--binlog-do-dbaffects binary logging, and the effects of the replication format on how--replicate-do-dbaffects replication behavior are the same as those of the logging format on the behavior of--binlog-do-db.This option has no effect on
BEGIN,COMMIT, orROLLBACKstatements.As with
--replicate-do-db, the effects of this option depend on whether statement-based or row-based replication is in use.Statement-based replication. Tells the slave SQL thread not to replicate any statement where the default database (that is, the one selected by
USE) isdb_name.Row-based replication. Tells the slave SQL thread not to update any tables in the database
db_name. The default database has no effect.When using statement-based replication, the following example does not work as you might expect. Suppose that the slave is started with
--replicate-ignore-db=salesand you issue the following statements on the master:USE prices; UPDATE sales.january SET amount=amount+1000;
The
UPDATEstatement is replicated in such a case because--replicate-ignore-dbapplies only to the default database (determined by theUSEstatement). Because thesalesdatabase was specified explicitly in the statement, the statement has not been filtered. However, when using row-based replication, theUPDATEstatement's effects are not propagated to the slave, and the slave's copy of thesales.januarytable is unchanged; in this instance,--replicate-ignore-db=salescauses all changes made to tables in the master's copy of thesalesdatabase to be ignored by the slave.To specify more than one database to ignore, use this option multiple times, once for each database. Because database names can contain commas, if you supply a comma separated list then the list will be treated as the name of a single database.
You should not use this option if you are using cross-database updates and you do not want these updates to be replicated. See Section 17.2.3, “How Servers Evaluate Replication Filtering Rules”.
If you need cross-database updates to work, use
--replicate-wild-ignore-table=instead. See Section 17.2.3, “How Servers Evaluate Replication Filtering Rules”.db_name.%NoteThis option affects replication in the same manner that
--binlog-ignore-dbaffects binary logging, and the effects of the replication format on how--replicate-ignore-dbaffects replication behavior are the same as those of the logging format on the behavior of--binlog-ignore-db.This option has no effect on
BEGIN,COMMIT, orROLLBACKstatements.--replicate-do-table=db_name.tbl_nameTells the slave SQL thread to restrict replication to the specified table. To specify more than one table, use this option multiple times, once for each table. This works for both cross-database updates and default database updates, in contrast to
--replicate-do-db. See Section 17.2.3, “How Servers Evaluate Replication Filtering Rules”.This option affects only statements that apply to tables. It does not affect statements that apply only to other database objects, such as stored routines. To filter statements operating on stored routines, use one or more of the
--replicate-*-dboptions.--replicate-ignore-table=db_name.tbl_nameTells the slave SQL thread not to replicate any statement that updates the specified table, even if any other tables might be updated by the same statement. To specify more than one table to ignore, use this option multiple times, once for each table. This works for cross-database updates, in contrast to
--replicate-ignore-db. See Section 17.2.3, “How Servers Evaluate Replication Filtering Rules”.This option affects only statements that apply to tables. It does not affect statements that apply only to other database objects, such as stored routines. To filter statements operating on stored routines, use one or more of the
--replicate-*-dboptions.--replicate-rewrite-db=from_name->to_nameTells the slave to translate the default database (that is, the one selected by
USE) toto_nameif it wasfrom_nameon the master. Only statements involving tables are affected (not statements such asCREATE DATABASE,DROP DATABASE, andALTER DATABASE), and only iffrom_nameis the default database on the master. This does not work for cross-database updates. To specify multiple rewrites, use this option multiple times. The server uses the first one with afrom_namevalue that matches. The database name translation is done before the--replicate-*rules are tested.If you use this option on the command line and the “
>” character is special to your command interpreter, quote the option value. For example:shell>
mysqld --replicate-rewrite-db="olddb->newdb"To be used on slave servers. Usually you should use the default setting of 0, to prevent infinite loops caused by circular replication. If set to 1, the slave does not skip events having its own server ID. Normally, this is useful only in rare configurations. Cannot be set to 1 if
--log-slave-updatesis used. By default, the slave I/O thread does not write binary log events to the relay log if they have the slave's server ID (this optimization helps save disk usage). If you want to use--replicate-same-server-id, be sure to start the slave with this option before you make the slave read its own events that you want the slave SQL thread to execute.--replicate-wild-do-table=db_name.tbl_nameTells the slave thread to restrict replication to statements where any of the updated tables match the specified database and table name patterns. Patterns can contain the “
%” and “_” wildcard characters, which have the same meaning as for theLIKEpattern-matching operator. To specify more than one table, use this option multiple times, once for each table. This works for cross-database updates. See Section 17.2.3, “How Servers Evaluate Replication Filtering Rules”.This option applies to tables, views, and triggers. It does not apply to stored procedures and functions, or events. To filter statements operating on the latter objects, use one or more of the
--replicate-*-dboptions.Example:
--replicate-wild-do-table=foo%.bar%replicates only updates that use a table where the database name starts withfooand the table name starts withbar.If the table name pattern is
%, it matches any table name and the option also applies to database-level statements (CREATE DATABASE,DROP DATABASE, andALTER DATABASE). For example, if you use--replicate-wild-do-table=foo%.%, database-level statements are replicated if the database name matches the patternfoo%.To include literal wildcard characters in the database or table name patterns, escape them with a backslash. For example, to replicate all tables of a database that is named
my_own%db, but not replicate tables from themy1ownAABCdbdatabase, you should escape the “_” and “%” characters like this:--replicate-wild-do-table=my\_own\%db. If you use the option on the command line, you might need to double the backslashes or quote the option value, depending on your command interpreter. For example, with the bash shell, you would need to type--replicate-wild-do-table=my\\_own\\%db.--replicate-wild-ignore-table=db_name.tbl_nameTells the slave thread not to replicate a statement where any table matches the given wildcard pattern. To specify more than one table to ignore, use this option multiple times, once for each table. This works for cross-database updates. See Section 17.2.3, “How Servers Evaluate Replication Filtering Rules”.
Example:
--replicate-wild-ignore-table=foo%.bar%does not replicate updates that use a table where the database name starts withfooand the table name starts withbar.For information about how matching works, see the description of the
--replicate-wild-do-tableoption. The rules for including literal wildcard characters in the option value are the same as for--replicate-wild-ignore-tableas well.The host name or IP address of the slave to be reported to the master during slave registration. This value appears in the output of
SHOW SLAVE HOSTSon the master server. Leave the value unset if you do not want the slave to register itself with the master. Note that it is not sufficient for the master to simply read the IP address of the slave from the TCP/IP socket after the slave connects. Due to NAT and other routing issues, that IP may not be valid for connecting to the slave from the master or other hosts.The account password of the slave to be reported to the master during slave registration. This value appears in the output of
SHOW SLAVE HOSTSon the master server if the--show-slave-auth-infooption is given.The TCP/IP port number for connecting to the slave, to be reported to the master during slave registration. Set this only if the slave is listening on a nondefault port or if you have a special tunnel from the master or other clients to the slave. If you are not sure, do not use this option.
The account user name of the slave to be reported to the master during slave registration. This value appears in the output of
SHOW SLAVE HOSTSon the master server if the--show-slave-auth-infooption is given.Display slave user names and passwords in the output of
SHOW SLAVE HOSTSon the master server for slaves started with the--report-userand--report-passwordoptions.Tells the slave server not to start the slave threads when the server starts. To start the threads later, use a
START SLAVEstatement.--slave_compressed_protocol={0|1}If this option is set to 1, use compression for the slave/master protocol if both the slave and the master support it. The default is 0 (no compression).
The name of the directory where the slave creates temporary files. This option is by default equal to the value of the
tmpdirsystem variable. When the slave SQL thread replicates aLOAD DATA INFILEstatement, it extracts the file to be loaded from the relay log into temporary files, and then loads these into the table. If the file loaded on the master is huge, the temporary files on the slave are huge, too. Therefore, it might be advisable to use this option to tell the slave to put temporary files in a directory located in some file system that has a lot of available space. In that case, the relay logs are huge as well, so you might also want to use the--relay-logoption to place the relay logs in that file system.The directory specified by this option should be located in a disk-based file system (not a memory-based file system) because the temporary files used to replicate
LOAD DATA INFILEmust survive machine restarts. The directory also should not be one that is cleared by the operating system during the system startup process.The number of seconds to wait for more data from the master before the slave considers the connection broken, aborts the read, and tries to reconnect. The first retry occurs immediately after the timeout. The interval between retries is controlled by the
MASTER_CONNECT_RETRYoption for theCHANGE MASTER TOstatement, and the number of reconnection attempts is limited by the--master-retry-countoption. The default is 3600 seconds (one hour).--slave-skip-errors=[err_code1,err_code2,...|all]Normally, replication stops when an error occurs on the slave. This gives you the opportunity to resolve the inconsistency in the data manually. This option tells the slave SQL thread to continue replication when a statement returns any of the errors listed in the option value.
Do not use this option unless you fully understand why you are getting errors. If there are no bugs in your replication setup and client programs, and no bugs in MySQL itself, an error that stops replication should never occur. Indiscriminate use of this option results in slaves becoming hopelessly out of synchrony with the master, with you having no idea why this has occurred.
For error codes, you should use the numbers provided by the error message in your slave error log and in the output of
SHOW SLAVE STATUS. Appendix C, Errors, Error Codes, and Common Problems, lists server error codes.You can also (but should not) use the very nonrecommended value of
allto cause the slave to ignore all error messages and keeps going regardless of what happens. Needless to say, if you useall, there are no guarantees regarding the integrity of your data. Please do not complain (or file bug reports) in this case if the slave's data is not anywhere close to what it is on the master. You have been warned.Examples:
--slave-skip-errors=1062,1053 --slave-skip-errors=all
Obsolete options.
The following options are removed in MySQL
5.5. If you attempt to start
mysqld with any of these options in MySQL
5.5, the server aborts with an unknown
variable error. To set the replication
parameters formerly associated with these options, you must use
the CHANGE MASTER TO ... statement (see
Section 12.5.2.1, “CHANGE MASTER TO Syntax”).
The options affected are shown in this list:
System variables used on replication slaves.
The following list describes system variables for controlling
replication slave servers. They can be set at server startup and
some of them can be changed at runtime using
SET.
Server options used with replication slaves are listed earlier
in this section.
Command-Line Format --init-slave=nameOption-File Format init_slaveOption Sets Variable Yes, init_slaveVariable Name init_slaveVariable Scope Global Dynamic Variable Yes Permitted Values Type stringThis variable is similar to
init_connect, but is a string to be executed by a slave server each time the SQL thread starts. The format of the string is the same as for theinit_connectvariable.NoteThe SQL thread sends an acknowledgment to the client before it executes
init_slave. Therefore, it is not guaranteed thatinit_slavehas been executed whenSTART SLAVEreturns. See Section 12.5.2.5, “START SLAVESyntax”, for more information.Enables automatic relay log recovery immediately following server startup, which means that the replication slave discards all unprocessed relay logs and retrieves them from the replication master. This should be used following a crash on the replication slave to ensure that no possibly corrupted relay logs are processed. The default value is 0 (disabled). This global variable can be changed dynamically, or by starting the slave with the
--relay-log-recoveryoption.This variable is unused, and is removed in MySQL 5.6.
Command-Line Format --slave_compressed_protocolOption-File Format slave_compressed_protocolOption Sets Variable Yes, slave_compressed_protocolVariable Name slave_compressed_protocolVariable Scope Global Dynamic Variable Yes Permitted Values Type booleanDefault OFFWhether to use compression of the slave/master protocol if both the slave and the master support it.
Variable Name slave_exec_modeVariable Scope Global Dynamic Variable Yes Permitted Values Type enumerationDefault STRICT(ALL)Default IDEMPOTENT(NDB)Valid Values IDEMPOTENT,STRICTControls whether
IDEMPOTENTorSTRICTmode is used in replication conflict resolution and error checking.IDEMPOTENTmode causes suppression of duplicate-key and no-key-found errors. This mode should be employed in multi-master replication, circular replication, and some other special replication scenarios.STRICTmode is the default, and is suitable for most other cases.Command-Line Format --slave-load-tmpdir=pathOption-File Format slave-load-tmpdirOption Sets Variable Yes, slave_load_tmpdirVariable Name slave_load_tmpdirVariable Scope Global Dynamic Variable No Permitted Values Type file nameDefault /tmpThe name of the directory where the slave creates temporary files for replicating
LOAD DATA INFILEstatements.Command-Line Format --slave-net-timeout=#Option-File Format slave-net-timeoutOption Sets Variable Yes, slave_net_timeoutVariable Name slave_net_timeoutVariable Scope Global Dynamic Variable Yes Permitted Values Type numericDefault 3600Min Value 1The number of seconds to wait for more data from a master/slave connection before aborting the read. This timeout applies only to TCP/IP connections, not to connections made using Unix socket files, named pipes, or shared memory.
Command-Line Format --slave-skip-errors=nameOption-File Format slave-skip-errorsOption Sets Variable Yes, slave_skip_errorsVariable Name slave_skip_errorsVariable Scope Global Dynamic Variable No Normally, replication stops when an error occurs on the slave. This gives you the opportunity to resolve the inconsistency in the data manually. This variable tells the slave SQL thread to continue replication when a statement returns any of the errors listed in the variable value.
Command-Line Format --slave_transaction_retries=#Option-File Format slave_transaction_retriesOption Sets Variable Yes, slave_transaction_retriesVariable Name slave_transaction_retriesVariable Scope Global Dynamic Variable Yes Permitted Values Platform Bit Size 32Type numericDefault 10Range 0-4294967295Permitted Values Platform Bit Size 64Type numericDefault 10Range 0-18446744073709547520If a replication slave SQL thread fails to execute a transaction because of an
InnoDBdeadlock or because the transaction's execution time exceededInnoDB'sinnodb_lock_wait_timeout, it automatically retriesslave_transaction_retriestimes before stopping with an error. The default value is 10.Version Introduced 5.5.3 Command-Line Format --slave_type_conversions=setOption-File Format slave_type_conversionsOption Sets Variable Yes, slave_type_conversionsVariable Name slave_type_conversionsVariable Scope Global Dynamic Variable No Permitted Values Type stringDefault Valid Values ALL_LOSSY,ALL_NON_LOSSY,ALL_LOSSY,ALL_NON_LOSSYControls the type conversion mode in effect on the slave when using row-based replication. Its value is a comma-delimited set of zero or more elements from the list:
ALL_LOSSY,ALL_NON_LOSSY. Set this variable to an empty string to disallow type conversions between the master and the slave. Changes require a restart of the slave to take effect.For additional information on type conversion modes applicable to attribute promotion and demotion in row-based replication, see Row-based replication: attribute promotion and demotion.
This variable was added in MySQL 5.5.3.
Variable Name sql_slave_skip_counterVariable Scope Global Dynamic Variable Yes Permitted Values Type numericThe number of events from the master that a slave server should skip.
ImportantIf skipping the number of events specified by setting this variable would cause the slave to begin in the middle of an event group, the slave continues to skip until it finds the beginning of the next event group and begins from that point. For more information, see Section 12.5.2.4, “
SET GLOBAL sql_slave_skip_counterSyntax”.Command-Line Format --sync-master-info=#Option-File Format sync_master_infoOption Sets Variable Yes, sync_master_infoVariable Name sync_master_infoVariable Scope Global Dynamic Variable Yes Permitted Values Platform Bit Size 32Type numericDefault 0Range 0-4294967295Permitted Values Platform Bit Size 64Type numericDefault 0Range 0-18446744073709547520If the value of this variable is greater than 0, a replication slave synchronizes its
master.infofile to disk (usingfdatasync()) after everysync_master_infoevents. The default value ofsync_relay_log_infois 0 (recommended in most situations), which does not force any synchronization to disk by the MySQL server; in this case, the server relies on the operating system to flush themaster.infofile's contents from time to time as for any other file.Command-Line Format --sync-relay-log=#Option-File Format sync_relay_logOption Sets Variable Yes, sync_relay_logVariable Name sync_relay_logVariable Scope Global Dynamic Variable Yes Permitted Values Platform Bit Size 32Type numericDefault 0Range 0-4294967295Permitted Values Platform Bit Size 64Type numericDefault 0Range 0-18446744073709547520If the value of this variable is greater than 0, the MySQL server synchronizes its relay log to disk (using
fdatasync()) after everysync_relay_logwrites to the relay log. There is one write to the relay log per statement if autocommit is enabled, and one write per transaction otherwise. The default value ofsync_relay_logis 0, which does no synchronizing to disk—in this case, the server relies on the operating system to flush the relay log's contents from time to time as for any other file. A value of 1 is the safest choice because in the event of a crash you lose at most one statement or transaction from the relay log. However, it is also the slowest choice (unless the disk has a battery-backed cache, which makes synchronization very fast).Command-Line Format --sync-relay-log-info=#Option-File Format sync_relay_log_infoOption Sets Variable Yes, sync_relay_log_infoVariable Name sync_relay_log_infoVariable Scope Global Dynamic Variable Yes Permitted Values Platform Bit Size 32Type numericDefault 0Range 0-4294967295Permitted Values Platform Bit Size 64Type numericDefault 0Range 0-18446744073709547520If the value of this variable is greater than 0, a replication slave synchronizes its
relay-log.infofile to disk (usingfdatasync()) after everysync_relay_log_infotransactions. A value of 1 is the generally the best choice. The default value ofsync_relay_log_infois 0, which does not force any synchronization to disk by the MySQL server—in this case, the server relies on the operating system to flush therelay-log.infofile's contents from time to time as for any other file.