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