MySQL binary logs are opened and used

Source: Internet
Author: User

The binary log (BINLOG) records all DDL and DML statements, but does not include data query statements. Statements are saved as "events", describing the process of data changes.

Environment: Win8 mysql5.6.23

1.mysql Open Binary Log

Binary logs are not turned on by default, and the My.ini configuration file needs to be modified when turned on

My My.ini file is in C:\ProgramData\MySQL\MySQL Server 5.6,

Instead of C:\Program files (x86) \mysql\mysql Server 5.6 needs to add the following statement under the My.ini file mysqld option

" D:\mysqllog\binlog.log "

After the equals sign, the path to the binary log file is saved, and if there are spaces in the path, enclose the path with a double quote "". Binlog.log is the name that generates the binary log

Modify the file properties if the content cannot be modified so that the current user can edit

If only the file name (Binlog.log) is given, the path is not given,

The path specified in DataDir is saved, and my default path is C:\ProgramData\Mysql\Mysql Server 5.6\data

There are three binary log formats statement ROW MIXED, which defaults to MIXED.

Generally do not modify, to modify, also add in the My.ini mysqld option: "binlog_format=" (quotation marks do not, after the equals sign plus the format you want)

After modifying, restart the MySQL service. I restarted the service with the Services MySQL restart command at the command line and the binary log did not open successfully and the computer was restarted before it was configured successfully.

2. Log Reads

Log - file

Log-file is the name, each time the data in the database is modified to generate a log file, the name format is "log-file.0000n" (file name + log sequence number), go to the binary log file generation path below to see the following will know

When executing this command, you need to enter the binary log path to use the Msyqlbinlog command, otherwise the error

MySQL binary logs are opened and used

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.