STOP 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
STOP REPLICA ["connection_name"] [thread_type [, thread_type] ... ] [FOR CHANNEL "connection_name"] STOP ALL REPLICAS [thread_type [, thread_type]] STOP REPLICA ["connection_name"] [thread_type [, thread_type] ... ] STOP ALL REPLICAS [thread_type [, thread_type]] thread_type: IO_THREAD | SQL_THREAD
Description
Stops the replica threads. STOP REPLICA
requires the SUPER privilege, or, from MariaDB 10.5.2, the REPLICATION SLAVE ADMIN privilege.
Like START REPLICA, this statement may be used with the IO_THREAD
and
SQL_THREAD
options to name the thread or threads to be stopped. In almost all cases, one never need to use the thread_type
options.
STOP REPLICA
waits until any current replication event group affecting
one or more non-transactional tables has finished executing (if there
is any such replication group), or until the user issues a KILL QUERY or KILL CONNECTION statement.
Note that STOP REPLICA
doesn't delete the connection permanently. Next time you execute START REPLICA or the MariaDB server restarts, the replica connection is restored with it's original arguments. If you want to delete a connection, you should execute RESET REPLICA.
STOP ALL REPLICAS
STOP ALL REPLICAS
stops all your running replicas. It will give you a note
for every stopped connection. You can check the notes with SHOW WARNINGS.
connection_name
The connection_name
option is used for multi-source replication.
If there is only one nameless master, or the default master (as specified by the default_master_connection system variable) is intended, connection_name
can be omitted. If provided, the STOP REPLICA
statement will apply to the specified master. connection_name
is case-insensitive.
MariaDB starting with 10.7.0
The FOR CHANNEL
keyword was added for MySQL compatibility. This is identical as
using the channel_name directly after STOP REPLICA
.
See Also
- CHANGE MASTER TO is used to create and change connections.
- START REPLICA is used to start a predefined connection.
- RESET REPLICA is used to reset parameters for a connection and also to permanently delete a master connection.