在 C# 中解码 mysqlbinlog
MySQL 将数据库的所有更改保存在称为二进制日志的二进制文件中。 MySQL提供了一个名为mysqlbinlog的解码器来解码这些文件。我想,如果我想直接从应用程序解析这个日志文件,那么我需要找到一种方法,例如使用 C# 自己对其进行解码。
我知道如果我有特权我可以使用 SHOW BINLOG EVENTS。但是,解析文件对我来说是更好的解决方案。
你们中有人以前这样做过吗?有什么建议吗?
MySQL saves all changes to the database in a binary file called binary log.
MySQL provides a decoder called mysqlbinlog to decode these files. I thought if I wanted to parse this log file directly from an application then I need to find a way to decode it myself using C# for instance.
I know if I had the privilege I could use SHOW BINLOG EVENTS. However, parsing the file would be a better solution for me.
Has any of you done that before? Any suggestions?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
查看 mysqlbinlog 工具代码可能是有用。此外,该工具的依赖项可在此处获取
A look into the mysqlbinlog-tool code might be useful. Additionally, the dependencies of that tool are available here
由于我不是 C++ 专家,并且需要相当长的时间才能弄清楚 tuergeist 建议的代码,因此我选择了另一种方法。
既然已经提供了 mysqlbinlog 为什么不使用它呢?
我还没有测试过,但我正在努力......
Since I am not a C++ expert and would take considerably long for me to figure out the code suggested by tuergeist, I have choosen another approach.
Since mysqlbinlog is already provided why not use it?
I haven't tested it yet, but I'm working on it...