MYSQL Binary Logs And Purge
In one of our projects we were required to keep track of the changes in the database for a particular period of time. MySQL has an inbuilt functionality for saving information on data modification for a specific period of time in log files.
To display content of a binary log , myslbinlog command can be called. However, this command also requires parameters including the log file name. A proper invocation of this method would look like the following.
mysqlbinlog [options] log_file..
There are plenty of options available but for demonstration’s sake I will describe a few only.
Besides these, there are many more options available which can be found in MySQL documentation.
To get a binary log file we can use something like –
shell> mysqlbinlog bin.001 > test.txt // which is used to put the log in text format
|
PURGING IN BINARY LOGS
Purge is used to delete the binary logs from the bin. It can used by the following syntax.
PURGE { BINARY | MASTER } LOGS
{ TO ‘
log_name ‘ | BEFOREdatetime_expr }
Additional Information
|
0 comments:
Post a Comment