`
willvvv
  • 浏览: 328675 次
  • 性别: Icon_minigender_1
  • 来自: 深圳
社区版块
存档分类
最新评论

ib_logfile和binary log file的区别

 
阅读更多

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.csdn.net/fafa211/article/details/2361066



使用下面的命令查看ib_logfile里的内容
$ strings ib_logfile<file-no.>

 

  • 大小: 9.1 KB
  • 大小: 42.6 KB
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics