Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Use the mysqlbinlog command to view the database log file and what if there is an error?

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

The following content mainly brings you how to use the mysqlbinlog command to check the database log file how to report an error. The knowledge mentioned is slightly different from books, which are summed up by professional and technical personnel in the process of contact with users, and have certain experience sharing value. I hope to bring help to the majority of readers.

[root@Darren1 logs] # mysqlbinlog-vv-base64-output=decode-rows mysql-bin.000006

/ *! 40019 SET @ @ session.max_insert_delayed_threads=0*/

/ *! 50003 SET @ OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/

DELIMITER / *! * /

# at 4

# 170415 1:28:13 server id 23306 end_log_pos 123 Start: binlog v 4, server v 5.7.16-log created 170415 1:28:13

# Warning: this binlog is either in use or was not closed properly.

ERROR: Error in Log_event::read_log_event (): 'Sanity check failed', data_len: 71, event_type: 35

DELIMITER

# End of log file

ROLLBACK / * added by mysqlbinlog * /

/ *! 50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/

By consulting the data, some netizens said that the mysqlbinlog version may not match the database service version, and then I will not report an error when I use full path / usr/local/mysql/bin/mysqlbinlog to view the log file.

Then, when you look at the location of the mysqlbinlog command through the which command, you find:

[root@Darren1 logs] # which mysqlbinlog

/ usr/bin/mysqlbinlog

The mysqlbinlog in this location is really not the location of the script I installed, and the / usr/local/mysql/bin/ directory is where I specified the location to store the scripting tools, so where did / usr/bin/mysqlbinlog come from? The preliminary judgment is that it was generated when the rpm version of mysql was accidentally installed.

Then knowing the reason, the problem can be easily solved:

Remove all mysql tools in the / usr/bin/ directory and configure the environment variables:

[root@Darren1 bin] # rm-rf / usr/bin/mysql*

[root@Darren1 bin] # echo 'export PATH=$PATH:/usr/local/mysql/bin/' > > / etc/profile

[root@Darren1 bin] # source / etc/profile

[root@Darren1 logs] # which mysqlbinlog

/ usr/local/mysql/bin/mysqlbinlog

In this way, the system uses the corresponding version of mysqlbinlog by default.

For the above about using the mysqlbinlog command to view database log files, what to do? if you have more information, you can continue to pay attention to the innovation of our industry. If you need to get professional answers, you can contact the pre-sale and after-sale on the official website. I hope this article can bring you some knowledge updates.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report