[Gllug] OT: mysql innodb files
Sean Burlington
sean at uncertainty.org.uk
Tue Feb 8 13:47:31 UTC 2005
Magnus Nilsson wrote:
> On Tue, 2005-02-08 at 11:11 +0000, Minty wrote:
>
>>in my mysql/4.1.19/data dir, there are a bunch of files named
>>
>> <servername>-bin.000001
>
> They're binary logs, used for replication purposes. If you take a look
> in your config file (my.cnf) you'll probably have a line starting with
> "bin-log". If you're sure that you're not using any kind of replication
> you can safely remove that line, stop and restart the server and remove
> the <servername>-bin.* files.
>
Even if you are not using them for replication you might want to keep
them around.
Especially if you have ever entered an update statement and forgotten to
add the where clause!
http://dev.mysql.com/doc/mysql/en/binary-log.html
The binary log contains all statements which updated data or (starting
from MySQL 4.1.3) could potentially have updated it (for example, a
DELETE which matched no rows).
The primary purpose of the binary log is to be able to update the
database during a restore operation as fully as possible, because the
binary log will contain all updates done after a backup was made.
http://dev.mysql.com/doc/mysql/en/mysqlbinlog.html
You can also redirect the output of mysqlbinlog to a text file instead,
if you need to modify the statement log first (for example, to remove
statements that you don't want to execute for some reason). After
editing the file, execute the statements that it contains by using it as
input to the mysql program.
mysqlbinlog has the --position option, which prints only those
statements with an offset in the binary log greater than or equal to a
given position (the given position must match the start of one event).
It also has options to stop or start when it sees an event of a given
date and time. This enables you to perform point-in-time recovery using
the --stop-datetime option (to be able to say, for example, "roll
forward my databases to how they were today at 10:30 AM").
--
Sean
--
Gllug mailing list - Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug
More information about the GLLUG
mailing list