binlog is a binary log file, which records all mysql dml operations. Through binlog logs, we can perform data recovery, master-slave replication, and so on. Developers may not pay much attention to binlog, but it is very important for operation and maintenance or architecture personnel. How to enable mysql binlog? Add three lines directly to the my.inf main configuration file log_bin=ON log_bin_basename=/var/lib/mysql/mysql-bin log_bin_index=/var/lib/mysql/mysql-bin.index Three parameters to specify, Of course, there is also a simple configuration, which can be done with one parameter log-bin=/var/lib/mysql/mysql-bin The function of this parameter is the same as the above three. MySQL will automatically set log_bin to on state according to this configuration, and automatically set the log_bin_index file to the file name you specify followed by .index After these configurations are completed, it should be possible for versions below 5.7, but if we are using version 5.7 or above at this time, restarting the MySQL service will result in an error. At this time we must also specify a parameter server-id=123454 Randomly assign a string that cannot be the same as the name of other machines in the cluster. If there is only one machine, you can assign it at random. With the above configuration, we can restart our mysql CentOS 6 service mysqld restart CentOS 7 systemctl restart mysqld After successful startup, we can log in to see if our configuration works show variables like '%log_bin%' Let's find this directory and take a look. Because I have already operated the database here, I can see that there are multiple mysql-bin files and a mysql-bin.index file. We can open this file to take a look. At this point, our binlog log is opened. For specific operations on binlog logs, please refer to This is the end of this article about the steps to enable MySQL binlog. For more information about enabling MySQL binlog, please search 123WORDPRESS.COM’s previous articles or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: Solve the conflict between docker and vmware
>>: Web Design: The Accurate Location and Use of Massive Materials
Through permission-based email marketing, not onl...
Method 1: Install the plugin via npm 1. Install n...
The vue project built with cli3 is known as a zer...
This article shares with you how to use Vue to dr...
Occasionally you'll see characters such as ...
Arrow function is a new feature in ES6. It does n...
How to add css in html? There are three ways to s...
<br />"There are no ugly women in the w...
1. Download MySQL Community Server 5.6.35 Downloa...
In the latest HTML standard, there is a calc CSS e...
The equal height layout described in this article...
Recently, Microsoft released the 2019 server syst...
Table of contents introduce Installation and Usag...
Record lock locks a single index record. Record l...
Version Chain In InnoDB engine tables, there are ...