日志文件:文件名.00000*
记录了对 MySQL 数据库执行了更改的所有操作
因为 binlog 的日志文件是二进制文件,不能用文本编辑器直接打开,需要用特定的工具来打开,MySQL 提供了 mysqlbinlog 来帮助我们查看日志文件内容
mysqlbinlog 可选参数很多, mysqlbinlog.exe --help
mysqlbinlog.exe Ver 3.3 for Win64 at x86
Copyright © 2001, 2010, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Dumps a MySQL binary log in a format usable for viewing or for piping to
the mysql command line client.
Usage: mysqlbinlog.exe [options] log-files
-?, --help Display this help and exit.
–base64-output[=name]
Determine when the output statements should be
base64-encoded BINLOG statements: ‘never’ disables it and
works only for binlogs without row-based events;
‘decode-rows’ decodes row events into commented SQL
statements if the --verbose option is also given; ‘auto’
prints base64 only when necessary (i.e., for row-based
events and format description events); ‘always’ prints
base64 whenever possible. ‘always’ is deprecated, will be
removed in a future version, and should not be used in a
production system. --base64-output with no ‘name’
argument is equivalent to --base64-output=always and is
also deprecated. If no --base64-output[=name] option is
given at all, the default is ‘auto’.
–character-sets-dir=name
Directory for character set files.
-d, --database=name List entries for just this database (local log only).
–debug-check Check memory and open file usage at exit .
–debug-info Print some debug info at exit.
-D, --disable-log-bin
Disable binary log. This is useful, if you enabled
–to-last-log and are sending the output to the same
MySQL server. This way you could avoid an endless loop.
You would also like to use it when restoring after a
crash to avoid duplication of the statements you already
have. NOTE: you will need a SUPER privilege to use this
option.
-F, --force-if-open Force if binlog was not closed properly.
(Defaults to on; use --skip-force-if-open to disable.)
-f, --force-read Force reading unknown binlog events.
-H, --hexdump Augment output with hexadecimal and ASCII event dump.
<