Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.
Original topic: tidb binlog 用什么工具查看呀
[root@localhost binlog]# mysqlbinlog binlog-0000000000000000-20220718021524
/!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1/;
/!40019 SET @@session.max_insert_delayed_threads=0/;
/!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0/;
DELIMITER /!/;
ERROR: File is not a binary log file.
DELIMITER ;
End of log file
ROLLBACK /* added by mysqlbinlog /;
/!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
/!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0/;
Use Reparo, refer to this link:
Follow-up question:
Can this directly view the binlog file? Is it possible that I’m using it incorrectly?
We haven’t enabled binlog, so it’s not easy to test. I feel that -log-file is the output log file. Try using the parameters -data-dir, -start-datetime, and -stop-datetime.
The previous reply measured -log-file and -data-dir in the image.
The error reported is failed: read binlog file name error: dir.
The file should be correct.
Judging by the error, it seems you need to provide the folder name.
Try using the parameters mentioned in this post:
Indeed, it worked after the change. Thank you, master!!!
It is possible to view the extracted binlog files.
The compatibility of mysqlbinlog is indeed not very good.
I output the binlog to a file to view its content. You can use reparo -data-dir /path/to/binlog/directory
and optionally add time filters with -start-datetime
and -stop-datetime
.
Yes, it will report an error and cannot be used.
It indicates that TiDB has indeed made modifications to the underlying logs.
This topic was automatically closed 1 minute after the last reply. No new replies are allowed.