简单执行
话不多说,我们直接上手使用这个命令试下
C:\mysql5715\data>C:\mysql5715\bin\mysqlbinlog.exe --no-defaults --database=test --base64-output=decode-rows -v mysql-bin.000001 >binlog007.sql
WARNING: The option --database has been used. It may filter parts of transactions, but will include the GTIDs in any case. If you want to exclude or include transactions, you should use the options --exclude-gtids or --include-gtids, respectively, instead.
结果被输入到binlog007.sql文件里
/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
# at 4
#210220 13:35:07 server id 1 end_log_pos 123 CRC32 0x4711132f Start: binlog v 4, server v 5.7.15-log created 210220 13:35:07 at startup
# Warning: this binlog is either in use or was not closed properly.
ROLLBACK/*!*/;
# at 123
#210220 13:35:07 server id 1 end_log_pos 154 CRC32 0xda13f808 Previous-GTIDs
# [empty]
# at 154
#210220 13:41:00 server id 1 end_log_pos 219 CRC32 0x0fa7a827 Anonymous_GTID last_committed=0 sequence_number=1
SET @@SESSION.GTID_NEXT= 'ANONYMOUS'/*!*/;
# at 219
#210220 13:41:00 server id 1 end_log_pos 291 CRC32 0x31a77419 Query thread_id=3 exec_time=0 error_code=0
SET TIMESTAMP=1613799