Which method would use mysqlbinlog for greater consistency?

Consider the three binary log files bin.00010, bin.00011, and bin.00012 from which you want to
restore data.
Which method would use mysqlbinlog for greater consistency?

Consider the three binary log files bin.00010, bin.00011, and bin.00012 from which you want to
restore data.
Which method would use mysqlbinlog for greater consistency?

A.
shell> mysqlbinlog bin.00010 | mysql
shell> mysqlbinlog bin.00011 | mysql
shell> mysqlbinlog bin.00012 | mysql

B.
shell> mysqlbinlog bin.00010 bin.00011 bin.00012 | mysql

C.
shell> mysqlbinlog – restore bin.00010 bin.00011 bin.00012

D.
shell> mysqlbinlog – include-gtide=ALL bin.00010 bin.00011 bin.00012 | mysql

Explanation:



Leave a Reply 5

Your email address will not be published. Required fields are marked *


wolfsrudel

wolfsrudel

B.

See manpage:
[…]
If you have more than one binary log to execute on the MySQL server, the safe method is to process them all using a single connection to the server. Here is an
example that demonstrates what may be unsafe:

shell> mysqlbinlog binlog.000001 | mysql -u root -p # DANGER!!
shell> mysqlbinlog binlog.000002 | mysql -u root -p # DANGER!!

Processing binary logs this way using multiple connections to the server causes problems if the first log file contains a CREATE TEMPORARY TABLE statement and the
second log contains a statement that uses the temporary table. When the first mysql process terminates, the server drops the temporary table. When the second
mysql process attempts to use the table, the server reports “unknown table.”

To avoid problems like this, use a single mysql process to execute the contents of all binary logs that you want to process. Here is one way to do so:

shell> mysqlbinlog binlog.000001 binlog.000002 | mysql -u root -p
[…]

Gabriel

Gabriel

A, it is asking about consistency. Running all in once might cause problems difficult to identify after it

igbinigun

igbinigun

http://dev.mysql.com/doc/refman/5.6/en/point-in-time-recovery.html

If you have more than one binary log to execute on the MySQL server, the safe method is to process them all using a single connection to the server. Here is an example that demonstrates what may be unsafe:

shell> mysqlbinlog binlog.000001 | mysql -u root -p # DANGER!!
shell> mysqlbinlog binlog.000002 | mysql -u root -p # DANGER!!