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

How to view mysql binlog

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

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

Editor to share with you how to view mysql binlog, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!

In MySQL or MariaDB, that particular event is logged whenever you make changes to the database.

For example, when you create a new table or update data on an existing table, these events are stored in mysql binlog, the binary log of the MySQL database.

Binary logs are very useful in MySQL replication, where the primary server sends data from the binary log to the remote server.

When you perform any type of restore operation in MySQL, you will also process the binary log files.

The mysqlbinlog command is used to view the contents of the binary log in a readable, user-friendly format.

So how do we get to view the mysql binlog (binary log)?

The following is to introduce the command method to get the current binary log list.

Execute the following show binary logs command from mysql, which displays all binary logs in the system.

Mysql > SHOW BINARY LOGS;+-+-+ | Log_name | File_size | +-+-+ | mysqld-bin.000001 | 15740 | mysqld-bin.000002 | 3319 |....

If binary logging is not enabled, you will see the following error message.

Mysql > SHOW BINARY LOGS;ERROR 1381 (HY000): You are not using binary logging

Where is the location of mysql binlog?

By default, the binary log files are located in the / var/lib/mysql directory, as shown below.

# ls-l / var/lib/mysql/-rw-rw----. 1 mysql mysql 15740 Aug 16 14:57 mysqld-bin.000001-rw-rw----. 1 mysql mysql 3319 Aug 16 14:57 mysqld-bin.000002.... The above is how to view all the content of mysql binlog, thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

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