Oracle 5.0 Reference Manual page 1146

Table of Contents

Advertisement

3. Determine the earliest log file among all the slaves. This is the target file. If all the slaves are up to
date, this is the last log file on the list.
4. Make a backup of all the log files you are about to delete. (This step is optional, but always
advisable.)
5. Purge all log files up to but not including the target file.
You can also set the
after a given number of days (see
replication, you should set the variable no lower than the maximum number of days your slaves might
lag behind the master.
Prior to MySQL 5.0.60,
behave in the same way (and neither one behaved correctly) when binary log files listed in the
file had been removed from the system by some other means (such as using
with MySQL 5.0.60, both variants of the statement fail with an error in such cases. (Bug #18199, Bug
#18453) To handle such errors, edit the
that it lists only the binary log files that are actually present, then run again the
statement that failed.
13.4.1.2.
RESET MASTER
RESET MASTER
Deletes all binary log files listed in the index file, resets the binary log index file to be empty, and
creates a new binary log file. This statement is intended to be used only when the master is started for
the first time.
RESET MASTER
the setup as follows:
1. Start the master and slave, and start replication (see
2. Execute a few test queries on the master.
3. Check that the queries were replicated to the slave.
4. When replication is running correctly, issue
then verify that any unwanted data no longer exists on the slave.
5. Issue
RESET MASTER
After verifying the setup and getting rid of any unwanted and log files generated by testing, you can
start the slave and begin replicating.
SQL Statements for Controlling Master Servers
expire_logs_days
Section 5.1.4, "Server System
PURGE BINARY LOGS TO
Syntax
Important
The effects of
RESET MASTER
key ways:
1.
RESET MASTER
leaving only a single, empty binary log file with a numeric suffix of .000001,
whereas the numbering is not reset by
2.
RESET MASTER
are running. The behavior of
running is undefined (and thus unsupported), whereas
may be safely used while replication slaves are running.
LOGS
See also
Section 13.4.1.1,
can prove useful when you first set up the master and the slave, so that you can verify
on the master to clean up the test queries.
[450]
system variable to expire binary log files automatically
and
PURGE BINARY LOGS BEFORE
file (which is a simple text file) manually to ensure
.index
differ from those of
removes all binary log files that are listed in the index file,
PURGE BINARY
is not intended to be used while any replication slaves
RESET MASTER
"PURGE BINARY LOGS
Section 16.1.1, "How to Set Up
followed by
STOP SLAVE
1126
Variables"). If you are using
on Linux). Beginning
rm
PURGE BINARY LOGS
PURGE BINARY LOGS
LOGS.
when used while slaves are
PURGE BINARY
Syntax".
RESET SLAVE
did not
.index
in 2
Replication").
on the slave,

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mysql 5.0

Table of Contents