Name
START SLAVE
Synopsis
START SLAVE [IO_THREAD|SQL_THREAD] START SLAVE [SQL_THREAD] UNTIL MASTER_LOG_FILE = 'filename
', MASTER_LOG_POS =position
START SLAVE [SQL_THREAD] UNTIL RELAY_LOG_FILE = 'filename
', RELAY_LOG_POS =position
Use this statement to start a slave server. In the first syntax structure shown, you can start the slave with the I/O thread or just with the SQL thread by using the respective keyword. You can start both by listing both keywords, separated by a comma. The default is to start both. The I/O thread will cause the slave to read SQL queries from the master server and to record them in the relay logfile. The SQL thread will read the relay logfile and then execute the SQL statements.
The second syntax structure is used to
limit the reading of the threads to a specific point (given with
MASTER_LOG_POS
) in the master logfile (named with
the MASTER_LOG_FILE
parameter). With the
UNTIL
clause, processing of the logfiles given
will stop when the position given is reached. The third syntax
structure is used to specify the relay log file and to limit the
reading of it. If the SQL_THREAD
keyword is given
in either of these latter two syntax structures, the reading will be
limited to the SQL thread.
The starting of a slave thread
isn’t always dependable. Run the SHOW SLAVE
STATUS
statement to confirm that the thread began and
remained running.
Get MySQL in a Nutshell now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.