MySQL BINLOG mainly has two data formats: rowbase and statement. Statement is relatively simple, basically it is what records are executed, rowbase is more complex, and more information is hidden. If you use the BINLOG of rowbase, you must specify-V in mysqlbinlog. If you do not specify it, It is encrypted. Most of the information you see is garbled. For example: Command: mysqlbinlog-V mysql-bin.000006 | less BINLOG'
Kwepurmjawaakaaaacgcaaaaaa8aaaaaeabhrlc3qaaxqaaqmaaq =
Kwepurcjawaaigaaaeocaaaaaa8aaaaaeaaf/+ aqaaaa =
'/*! */;
### Insert into test. t
### Set
###@ 1 = 1 here is a tip if you specify twice-V can see more information: For example: Command: mysqlbinlog-VV mysql-bin.000006 | lessbinlog'
Kwepurmjawaakaaaacgcaaaaaa8aaaaaeabhrlc3qaaxqaaqmaaq =
Kwepurcjawaaigaaaeocaaaaaa8aaaaaeaaf/+ aqaaaa =
'/*! */;
### Insert into test. t
### Set
###@ 1 = 1/* int meta = 0 nullable = 1 is_null = 0 */
# At 586
#130204 15:21:53 server ID 777 end_log_pos 613 Xid = 6
Commit /*! */; You can see that the properties of the connected field are displayed. Twitter has also enhanced the BINLOG of rowbase. It adds an event to view the field name. Of course, this is quite simple. Can we remove garbled things like kwepurmjawaakaaaacgcaaaaaa8aaaaaeabhrlc3qaaxqaaqmaaq? In fact also line, as follows: Command: mysqlbinlog-VV -- base64-output = Decode-rows mysql-bin.000006 | less #130204 15:21:53 server ID 777 end_log_pos 383 table_map: 'test '. 't'ed ed to number 15
#130204 15:21:53 server ID 777 end_log_pos 417 write_rows: Table ID 15 flags: stmt_end_f
### Insert into test. t
### Set
###@ 1 = 1/* int meta = 0 nullable = 1 is_null = 0 */
# At 417 is not much clean. For more information, see -- base64-output [= Name] base64-encoded BINLOG statements: 'Never 'disables it and prints base64 only when necessary (I. E ., for row-based base64 whenever possible. 'alway' is for debugging only base64-output, consider using -- base64-output = never we all know statementdebinlog parsing can be executed, then rowbase? Can rowbased BINLOG be directly parsed for execution? I tried to parse it. 1. mysqlbinlog-vvv -- base64-output = row-based mysql-bin.000006> 12. Source 1 found no, because it is all comments. So what is the correct execution method? In fact, it is not so troublesome: mysqlbinlog mysql-bin.000006 | MySQL -- defaults-file = my1.cnf-uroot directly execute no problem, of course you can also add the start-position or start-time or something.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service