最新消息:20210816 当前crifan.com域名已被污染,为防止失联,请关注(页面右下角的)公众号

【已解决】如何查看mysql或mariadb的bin二进制的log文件内容

MySQL crifan 1323浏览 0评论
折腾:
【未解决】Ubuntu中mysql有时候会突然挂掉
期间,已经找到了的mysql的bin的log文件,但是发现是二进制的。
现在想要去查看其文本内容。
是二进制的文件,无法看清内容
ubuntu maria bin log
ubuntu mariadb bin log
ubuntu see content mariadb bin log
How to Disable Binary Logging in MariaDB?
logging – How to view mariadb log? – Server Fault
15 mysqlbinlog Command Examples for MySQL Binary Log Files
mysqlbinlog mariadb-bin.000392 > mariadb-bin.000392.txt
输出bin的log为文本到txt文件了。
【总结】
mysql有自带工具mysqlbinlog
(mac和Ubuntu中都有)
去导出为文本文件:
mysqlbinlog bin_log_filename-bin.xxx > output_filename.txt
即可查看文本内容。
摘录其中的部分内容,供参考:
# at 1134
#190605 22:35:01 server id 1 end_log_pos 1210 CRC32 0x8952b235   Query thread_id=132 exec_time=0 error_code=0
SET TIMESTAMP=1559745301/*!*/;

BEGIN
/*!*/;
# at 1210
#190605 22:35:01 server id 1 end_log_pos 1321 CRC32 0x64e2ae2e   Table_map: `xxx`.`yyy` mapped to number 108

# at 1321
#190605 22:35:01 server id 1 end_log_pos 1633 CRC32 0xeb775832   Write_rows: table id 108 flags: STMT_END_F
改后缀为sql,语法高亮后的效果是:

转载请注明:在路上 » 【已解决】如何查看mysql或mariadb的bin二进制的log文件内容

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
82 queries in 0.177 seconds, using 22.15MB memory