1.两者的区别:
The ib_logfile's hold statements affecting innodb tables only. If a crash occurs they are automatically used to complete any innodb transactions that didn't complete before the crash.
The bin logs record all statements that update data, regardless of engine. They are useful when you have to restore a backup and then roll forward to particular point in time and also to review what statements have been run.
iblogfile is temporary, only live till the data is updated into the tablespace, after which the space is reused.
binary log is more or a permanent and you have to purge the old logs yourself when it is not requried anymore.

2.如何查看两者的内容
使用下面的命令查看binlog里的内容
$ mysqlbinlog mysql-bin.<logfile-number>
注意:mysqlbinlog位于mysql的bin目录下,如果你的my.cnf的配置里面有:
[client] default-character-set=utf8
执行时报unknown variable 'default-character-set=utf8'错误,这时可以改成:
[client] loose-character-set = utf8
使用宽泛的设置,参见:http://blog.youkuaiyun.com/fafa211/article/details/2361066

使用下面的命令查看ib_logfile里的内容
$ strings ib_logfile<file-no.>
本文详细解析了MySQL binlog与ib_logfile的区别,包括它们的作用、查看方式及注意事项。通过对比,帮助读者深入理解这两种日志类型在数据库维护与恢复中的角色。
1525

被折叠的 条评论
为什么被折叠?



