Get the App
SLTechnology News&Howtos  ›  Development  › 

What are the formats of binary logs in mysql

Shulou Source: shulou.com Published: 2022-06-03 04:42:29 10月03日 Update

Editor to share with you what are the formats of the binary log in mysql, I believe most people don't know much about it, so share this article for your reference. I hope you can learn a lot after reading this article. Let's learn about it together.

1. STATEMENT is the SQL statement recorded in the log file.

Every SQL statement that modifies the data is recorded in the log. Using the mysqlbinlog tool provided by MySQL, you can clearly see that when the text of each statement is copied from the master and slave, the slave parses the log to the original text and re-executes it in the slave library.

2. The ROW log format records the changes of each line of data in the log file, rather than recording SQL statements.

3. MIXED log format is the default log format of MySQL, which is a mixture of the first two log formats.

Example

# vim my.cnf # configure log-bin = / data/3306/mysql-binbinlog_format= "STATEMENT" # binlog_format= "ROW" # binlog_format= "MIXED" in the [mysql] module or modify the environment variable to modify the binlog mode mysql > SET global binlog_format='STATEMENT'. All the contents of the article "what are the binary log formats in mysql"? 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!

Tags: Logs formats statements articles binaries content data files clear one line not much master and slave original text variables most instances tools text more modules Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno OPPO Reno Huawei MySQL Shulou Technology Redmi