RESET MASTER
Deletes all binary logs listed in the index file, resets the binary log index file to be empty, and creates a new binary log file. It is intended to be used only when the master is started for the first time.
The effects of this statement differ from those of
PURGE BINARY LOGS
in 2 key
ways:
RESET MASTER
removes
all binary logs that are listed in
the index file, leaving only a single, empty binary log
file named master-bin.000001, whereas the numbering is not
reset by PURGE BINARY LOGS
.
RESET MASTER
is
not intended to be used while any
replication slaves are running. The behavior of
RESET MASTER
when used
while slaves are running is undefined (and thus
unsupported), whereas PURGE BINARY
LOGS
may be safely used while replication slaves
are running.
RESET MASTER
can prove useful
when you first set up the master and the slave, so that you can
verify the setup as follows:
Start the master and slave, and start replication (see Section 16.1.1, “How to Set Up Replication”)
Execute a few test queries on the master
Check that the queries were replicated to the slave
When replication is running correctly, issue
STOP SLAVE
on the slave,
followed by RESET SLAVE
;
verify that any unwanted data no longer exists on the slave
Issue RESET MASTER
on the
master to clean up the test queries
After verifying the setup and getting rid of any unwanted and logs generated by testing, you can start the slave and begin replicating.
User Comments
Add your own comment.