All pages
Powered by GitBook
1 of 1

Loading...

START REPLICA

The terms master and slave have historically been used in replication, and MariaDB has begun the process of adding primary and replica synonyms. The old terms will continue to be used to maintain backward compatibility - see MDEV-18777 to follow progress on this effort.

Syntax

Description

START REPLICA is a synonym for START SLAVE, which is considered deprecated.

Only START SLAVE can be used.

START SLAVE or START REPLICA with no thread_type options starts both of the replica threads (see ) needed to connect with a master setup with The I/O thread reads events from the primary server and stores them in the . The SQL thread reads events from the relay log and executes them.

START REPLICA requires the privilege.

START REPLICA requires the privilege.

If START REPLICA succeeds in starting the replica threads, it returns without any error. However, even in that case, it might be that the replica threads start and then later stop (for example, because they do not manage to connect to the primary or read its , or some other problem). START REPLICA does not warn you about this. You must check the replica's for error messages generated by the replica threads or check that they are running satisfactorily with ().

START REPLICA UNTIL

START REPLICA UNTIL refers to the SQL_THREAD replica position at which the SQL_THREAD replication will halt. If SQL_THREAD isn't specified, both threads are started.

START REPLICA UNTIL master_gtid_pos=xxx is also supported. See for more details.

MariaDB starting with

SQL_BEFORE_GTIDS|SQL_AFTER_GTIDS

The START REPLICA UNTIL statement contains the options SQL_BEFORE_GTIDS and SQL_AFTER_GTIDS to allow control of whether the replica stops before or after a provided GTID state. Its syntax is:

See for details.

SQL_BEFORE_GTIDS and SQL_AFTER_GTIDS are not available.

connection_name

If there is only one nameless primary, or the default primary (as specified by the system variable) is intended, connection_name can be omitted. If provided, the START REPLICA statement will apply to the specified primary. connection_name is case-insensitive.

The FOR CHANNEL keyword is available for MySQL compatibility. This is identical to using the channel_name directly after START REPLICA.

The FOR CHANNEL keyword is not available.

START ALL REPLICAS

START ALL REPLICAS starts all configured replicas (replicas with master_host not empty) that were not started before. It will give a note for all started connections. You can check the notes with .

See Also

  • .

  • is used to create and change connections.

  • is used to stop a running connection.

  • is used to reset parameters for a connection and also to permanently delete a primary connection.

This page is licensed: GPLv2, originally from

START { SLAVE | REPLICA } ["connection_name"] [thread_type [, thread_type] ... ]
START { SLAVE | REPLICA } ["connection_name"] [SQL_THREAD] UNTIL                
    MASTER_LOG_FILE = 'log_name', MASTER_LOG_POS = log_pos 
START { SLAVE | REPLICA } ["connection_name"] [SQL_THREAD] UNTIL
    RELAY_LOG_FILE = 'log_name', RELAY_LOG_POS = log_pos 
START { SLAVE | REPLICA } ["connection_name"] [SQL_THREAD] UNTIL
    MASTER_GTID_POS = <GTID position> 
START ALL { SLAVES | REPLICAS } [thread_type [, thread_type]] 

thread_type: IO_THREAD | SQL_THREAD
replication
CHANGE MASTER TO.
relay log
REPLICATION SLAVE ADMIN
SUPER
binary log
error log
SHOW REPLICA STATUS
SHOW REPLICA STATUS
Global Transaction ID/START REPLICA UNTIL master_gtid_pos=xxx
Global Transaction ID#SQL_BEFORE_GTIDS/SQL_AFTER_GTIDS
default_master_connection
SHOW WARNINGS
Setting up replication
CHANGE MASTER TO
STOP REPLICA
RESET REPLICA
fill_help_tables.sql
START REPLICA UNTIL (SQL_BEFORE_GTIDS|SQL_AFTER_GTIDS)="<gtid_list>"
11.3.0