In a disaster, then, we first restore the primary backup as above, then we'll log files through the program mysqlbinlog:
Code:
mysqlbinlog nome_file_log nome_file_log | mysql
mysqlbinlog nome_file_log nome_file_log> filename
Use this command to give input in two log files in the program: in the first case we denote the direct output of the mysql client to rerun the instructions stored in the logs (remember to add the data for the connection!), And then rebuild the situation of the database. It is important, if the log files to be processed is more than one, re-execute them all with a single instruction. In the second case we write the output to a text file so you can then view and review. When reading binary logs we can define, in two ways, instructions to be taken into account: we can use a start and end timestamp, or positions on the file.
Code:
mysqlbinlog - start-date = "11/16/2010 9:55:00" - stop-date = "16/11/2010 10:00:00" file_name
mysqlbinlog - start-position = "2345" - stop-position = "4567" file_name
In the first case to say mysqlbinlog only read the instructions included between 9:55 and 10:00 on the date indicated, the second one showing their positions in the log file to reference. In both cases we can also use one of two options (beginning or end). To find out which positions refer, we can examine the program's output to the text file, which shows for each instruction stores the start position and end.
Bookmarks