Explanation event in mysqlbinlog -- hexdump

Source: Internet
Author: User

In mysqlbinlog, the event -- hexdump is interpreted in the binlog file. Sometimes the standard time that is printed out is not enough to determine a problem. Sometimes there is a special number, you cannot understand the meaning of the specific numeric details. To handle similar situations, you can use -- hexdump to print the details of related events. The following are examples: [html] [root @ Slave02 data] # mysqlbinlog -- hexdump/usr/local/mysql/data/mysql-bin.000011 /*! 40019 SET @ session. max_insert_delayed_threads = 0 */;/*! 50003 SET @ OLD_COMPLETION_TYPE = @ COMPLETION_TYPE, COMPLETION_TYPE = 0 */; DELIMITER /*! */; # At 4 #130401 9:38:04 server id 11 end_log_pos 107 # Position Timestamp Type Master ID Size Master Pos Flags #00000004 fc e4 58 51 0f 0b 00 00 00 00 00 00 6b 00 00 00 01 00 #00000017 04 00 35 2e 35 2e 31 33 2d 6c 6f 67 00 00 00 00 | .. 5.5.13.log....| #00000027 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................ | #00000037 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |... ............. | #00000047 00 00 00 00 fc e4 58 51 13 38 0d 00 08 00 12 00 | ...... xq.8 ...... | #00000057 04 04 04 12 00 00 00 54 00 04 1a 08 00 00 08 | ....... T ........ | #00000067 08 02 00 | .... | # Start: binlog v 4, server v 5.5.13-log created 130401 9:38:04 at startup # Warning: this binlog was not closed properly. most probably mysqld crashed writing it. ROLLBACK /*! */; DELIMITER; # End of log file ROLLBACK/* added by mysqlbinlog */;/*! 50003 SET COMPLETION_TYPE = @ OLD_COMPLETION_TYPE */; [root @ Slave02 data] # mysqlbinlog -- hexdump/usr/local/mysql/data/mysql-bin.0000 12 /*! 40019 SET @ session. max_insert_delayed_threads = 0 */;/*! 50003 SET @ OLD_COMPLETION_TYPE = @ COMPLETION_TYPE, COMPLETION_TYPE = 0 */; DELIMITER /*! */; # At 4 #130402 9:28:54 server id 11 end_log_pos 107 # Position Timestamp Type Master ID Size Master Pos Flags #00000004 56 34 5a 51 0f 0b 00 00 00 67 00 00 6b 00 00 00 01 00 #00000017 04 00 35 2e 35 2e 31 33 2d 6c 6f 67 00 00 00 00 | .. 5.5.13.log....| #00000027 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................ | #00000037 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |... ............. | #00000047 00 00 00 00 56 34 5a 51 13 38 0d 00 08 00 12 00 | .... v4ZQ. 8 ...... | #00000057 04 04 04 12 00 00 00 54 00 04 1a 08 00 00 08 | ....... T ........ | #00000067 08 02 00 | .... | # Start: binlog v 4, server v 5.5.13-log created 130402 9:28:54 at startup # Warning: this binlog was not closed properly. most probably mysqld crashed writing it. ROLLBACK /*! */; # At 107 #130402 15:45:51 server id 11 end_log_pos 367 # Position Timestamp Type Master ID Size Master Pos Flags # 0000006b af 8c 5a 51 02 0b 00 00 00 04 01 00 00 6f 01 00 00 00 00 # 0000007e 01 00 00 00 00 00 04 00 00 1a 00 00 00 00 00 | ................ | # 0000008e 00 00 01 00 00 00 00 00 00 06 03 73 74 64 | ............. std | # 0000009e 04 21 00 21 00 21 00 74 65 73 74 00 63 72 65 61 | ....... Test. crea | # 000000ae 74 65 20 74 61 62 6c 65 20 69 74 65 6d 73 28 0a | te. table. items .. | # 000000be 69 64 20 69 6e 74 20 6e 6f 74 20 6e 75 6c 6c 20 | id.int. not. null. | # 000000ce 61 75 74 6f 5f 69 6e 63 72 65 6d 65 6e 74 20 70 | auto. increment. p | # 201700de 72 69 6d 61 72 79 20 6b 65 79 2c 0a 73 68 6f 72 | rimary. key .. shor | # 000000ee 74 5f 64 65 73 63 72 69 70 74 69 6f 6e 20 76 61 | t. descript Ion. va | # 000000fe 72 63 68 61 72 28 32 35 29 2c 0a 64 65 73 63 | rchar.255... desc | # 0000010e 72 69 70 74 69 6f 6e 20 74 65 78 74 2c 0a 65 78 | ription. text .. ex | # 0000011e 61 6d 70 6c 65 20 74 65 78 74 2c 0a 65 78 70 6c | ample. text .. expl | # 0000012e 61 6e 61 74 69 6f 6e 20 74 65 78 74 2c 0a 61 64 | anation. text .. ad | # 0000013e 64 69 74 69 6f 6e 61 6c 20 74 65 78 74 29 20 65 | ditional. text .. e | # 0000014e 6e 67 69 6e 65 3d 69 6e 6e 6f 64 62 20 64 65 66 | ngine. innodb. def | # 0000015e 61 75 6c 74 20 63 68 61 72 73 65 74 3d 75 74 66 | ault. charset. utf | # 0000016e 38 | 8 | # Query thread_id = 1 exec_time = 0 error_code = 0 use test /*! */; Set timestamp = 1364888751 /*! */; SET @ session. foreign_key_checks = 1, @ session. SQL _auto_is_null = 0, @ session. unique_checks = 1 /*! */; SET @ session. SQL _mode = 0 /*! */;/*! \ C utf8 *//*! */; SET @ session. character_set_client = 33, @ session. collation_connection = 33, @ session. collation_server = 33 /*! */; Create table items (id int not null auto_increment primary key, short_description varchar (255), description text, example text, explanation text, additional text) engine = innodb default charset = utf8 /*! */; # At 367 #130402 16:57:39 server id 11 end_log_pos 435 # Position Timestamp Type Master ID Size Master Pos Flags # 0000016f 83 9d 5a 51 02 0b 00 00 00 44 00 00 00 00 b3 01 00 00 08 00 #00000182 01 00 00 00 00 00 00 00 00 00 1a 00 00 00 | ................ | #00000192 00 00 01 00 00 00 00 00 00 06 03 73 74 64 | ............. std | #000001a2 04 21 00 21 00 21 00 74 65 73 74 00 42 45 47 49 |... Test. BEGI | #000001b2 4e | N | # Query thread_id = 1 exec_time = 0 error_code = 0 set timestamp = 1364893059 /*! */; BEGIN /*! */; # At 435 #130402 16:57:39 server id 11 end_log_pos 528 # Position Timestamp Type Master ID Size Master Pos Flags #000001b3 83 9d 5a 51 02 0b 00 00 00 5d 00 00 00 10 02 00 00 00 00 #000001c6 01 00 00 00 00 00 04 00 00 1a 00 00 00 00 00 | ................ | #000001d6 00 00 01 00 00 00 00 00 00 06 03 73 74 64 | ............. std | #000001e6 04 21 00 21 00 21 00 74 65 73 74 00 64 65 6c 65 | ....... Test. dele | #000001f6 74 65 20 66 72 6f 6d 20 20 74 31 2c 74 32 20 75 | te. from .. t1.t2. u | #00000206 73 69 6e 67 20 74 31 2c 74 32 | sing. t1.t2 | # Query thread_id = 1 exec_time = 0 error_code = 0 set timestamp = 1364893059 /*! */; Delete from t1, t2 using t1, t2 /*! */; # At 528 #130402 16:57:39 server id 11 end_log_pos 597 # Position Timestamp Type Master ID Size Master Pos Flags #00000210 83 9d 5a 51 02 0b 00 00 00 45 00 00 00 55 02 00 00 08 00 #00000223 01 00 00 00 00 00 00 00 00 00 1a 00 00 00 | ................ | #00000233 00 00 01 00 00 00 00 00 00 06 03 73 74 64 | ............. std | #00000243 04 21 00 21 00 21 00 74 65 73 74 00 43 4f 4d 4d |... Test. COMM | #00000253 49 54 | IT | # Query thread_id = 1 exec_time = 0 error_code = 0 set timestamp = 1364893059 /*! */; COMMIT /*! */; DELIMITER; # End of log file ROLLBACK/* added by mysqlbinlog */;/*! 50003 SET COMPLETION_TYPE = @ OLD_COMPLETION_TYPE */; [root @ Slave02 data] # You can see that some information and specific event information are divided into two rows, and they are merged and displayed in the normal output;

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.