RESET REPLICA makes the replica forget its position in the master's . This statement is meant to be used for a clean start. It deletes the master.info and relay-log.info files, all the files, and starts a new relay log file. To use RESET REPLICA, the replica threads must be stopped (use if necessary).
Note: All relay log files are deleted, even if they have not been completely executed by the replica SQL thread. (This is a condition likely to exist on a replication replica if you have issued a STOP REPLICA statement or if the replica is highly loaded.)
Note: RESET REPLICA does not reset the globalgtid_slave_pos variable. This means that a replica server configured with CHANGE MASTER TO MASTER_USE_GTID=slave_pos will not receive events with GTIDs occurring before the state saved ingtid_slave_pos. If the intent is to reprocess these events,gtid_slave_pos must be manually reset, e.g., by executing set global gtid_slave_pos="".
Connection information stored in the master.info file is immediately reset using any values specified in the corresponding startup options. This information includes values such as master host, master port, master user, and master password. If the replica SQL thread was in the middle of replicating temporary tables when it was stopped, and RESET REPLICA is issued, these replicated temporary tables are deleted on the replica.
The ALL also resets the PORT, HOST, USER, and PASSWORD parameters for the replica. If you are using a connection name, it will be permanently deleted it and it will not show up anymore in .
The connection_name option is used for .
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 RESET REPLICA statement will apply to the specified primary. connection_name is case-insensitive.
MariaDB starting with
The FOR CHANNEL keyword was added for MySQL compatibility. This is identical to using the channel_name directly after RESET REPLICA.
FOR CHANNEL is not available.
The FOR CHANNEL keyword was added for MySQL compatibility. This is identical as using the channel_name directly after RESET REPLICA.
MariaDB starting with
RESET REPLICA resets the Master/Slave_last_event_time and Connects_Tried values (see ).
RESET REPLICA resets the Master/Slave_last_event_time values (see ).
RESET REPLICA does not reset the Master
stops the replica, but it can be restarted with or after next MariaDB server restart.
This page is licensed: GPLv2, originally from
RESET { SLAVE | REPLICA } ["connection_name"] [ALL] [FOR CHANNEL "connection_name"].Slave_last_event_time