For example, when you create a new table or update data on an existing table, these events are stored in the mysql binlog, which is the binary log of the MySQL database. Binary logs are very useful in MySQL replication, where the master server sends data from the binary log to the remote servers. When you perform any type of recovery operation in MySQL, you are also dealing with 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 and view mysql binlog (binary log)? The following is a command method to obtain the current binary log list. Execute the following show binary logs command from mysql which will display 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 on your system, you will see the following error message. mysql> SHOW BINARY LOGS; ERROR 1381 (HY000): You are not using binary logging Where is the mysql binlog location? 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 .. .. You may also be interested in:
|
<<: Build a server virtual machine in VMware Workstation Pro (graphic tutorial)
>>: Three ways to implement virtual hosts under Linux7
The parent node of the parent node, for example, t...
Preface MySQL master-slave replication is the bas...
Detailed example of removing duplicate data in My...
Preface When it comes to database transactions, a...
This article shares the MySQL free installation c...
Table of contents 1. Background: 2. Design ideas:...
1. Requirements description For a certain element...
Table of contents 1. Custom import in packaging t...
Illustrated CentOS 7.3 installation steps for you...
I used the Mysql FIND_IN_SET function in a projec...
Preface The file system is responsible for organi...
[LeetCode] 183.Customers Who Never Order Suppose ...
<br />I'm basically going crazy with thi...
1. Docker startup problem: Problem Solved: You ne...
I recently used nginx in a project, and used Java...