MySQL read_log_event (): & #39; Found invalid event in binary log & #39;, invalidbinary

Source: Internet
Author: User
Tags mysql command line

MySQL read_log_event (): 'found invalid event in binary log', invalidbinary

MySQL is known for its ease of use. It can install N different versions on the same server to facilitate testing and migration. In addition, mysql is integrated in most Linux systems and is installed by default. Therefore, problems with multiple versions may cause some inexplicable errors. Recently, when extracting binlog, we encountered a read_log_event, Found invalid event in binary log. It was found that the problem was caused by the mysqlbinlog version. For your reference.

 

1. fault description
[Root @ HKBO bak] # mysqlbinlog -- start-datetime = "00:30:00" mysql-bin.000399bk | more
ERROR: Error in Log_event: read_log_event (): 'found invalid event in binary log', data_len: 376, event_type: 19
/*! 40019 SET @ session. max_insert_delayed_threads = 0 */;
/*! 50003 SET @ OLD_COMPLETION_TYPE = @ COMPLETION_TYPE, COMPLETION_TYPE = 0 */;
DELIMITER /*! */;
# At 4
#141213 21:05:01 server id 11 end_log_pos 120 Start: binlog v 4, server v 5.6.12-log created 141213 21:05:01
# Warning: this binlog is either in use or was not closed properly.
DELIMITER;
# End of log file
ROLLBACK/* added by mysqlbinlog */;
/*! 50003 SET COMPLETION_TYPE = @ OLD_COMPLETION_TYPE */;

 

2. Fault Analysis and Solution
# View the current mysqlbinlog File
[Root @ HKBO bak] # which mysqlbinlog
/Usr/bin/mysqlbinlog

# Check the version of mysqlbinlog. The value is 3.2.
[Root @ HKBO bak] # mysqlbinlog -- version
Mysqlbinlog Ver 3.2 for redhat-linux-gnu at x86_64
# Author: Leshami
# Blog: http://blog.csdn.net/leshami

[Root @ HKBO bak] # whereis mysqlbinlog
Mysqlbinlog:/usr/bin/mysqlbinlog/usr/share/man/man1/mysqlbinlog.1.gz

# The installation path of this server is actually/app/soft/mysql/. Check that the version of mysqlbinlog is version 3.4.
[Root @ HKBO bak] #/app/soft/mysql/bin/mysqlbinlog -- version
/App/soft/mysql/bin/mysqlbinlog Ver 3.4 for Linux at x86_64

# Use the mysqlbinlog in the correct path.
[Root @ HKBO bak] #/app/soft/mysql/bin/mysqlbinlog -- start-datetime = "00:30:00" mysql-bin.000399bk | more
/*! 50530 SET @ SESSION. pseudo do_slave_mode = 1 */;
/*! 40019 SET @ session. max_insert_delayed_threads = 0 */;
/*! 50003 SET @ OLD_COMPLETION_TYPE = @ COMPLETION_TYPE, COMPLETION_TYPE = 0 */;
DELIMITER /*! */;
# At 4
#141213 21:05:01 server id 11 end_log_pos 120 CRC32 0xaafb2293 Start: binlog v 4, server v 5.6.12-log created 141213 21:05:01
# Warning: this binlog is either in use or was not closed properly.
Binlog'
Bytes
Bytes
+ 6o =
'/*! */;
# At 594054457

# View the mysql version of the current system
#/App/soft/mysql/bin/mysql -- version
/App/soft/mysql/bin/mysql Ver 14.14 Distrib 5.6.12, for Linux (x86_64) using EditLine wrapper

# The following are the default versions installed during OS installation:
# Rpm-qa | grep-I mysql
Mysql-5.0.95-3.el5

 

3. Summary
A. For mysql deployment in the production environment, we recommend that you do not install the default mysql or uninstall the default mysql before installing the OS.
B. if multiple versions are required, use the direct path method to execute the mysql command line tool.

Related Article

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.