欢迎来到福编程网,本站提供各种互联网专业知识!
您的位置:网站首页 > 数据库 > Mysql

使用bin-log日志还原数据库的例子

发布时间:2013-02-05 作者: 来源:转载
使用bin-log日志还原数据库的例子,供大家学习参考

1、查看是否启用了日志:
show variables like 'log_bin';

2、查看当前日志文件名:
show master status;

3、查找当前有哪些二进制日志文件:
mysql> show binary logs;

4、查看mysql日志:
mysqlbinlog mysql-bin.000001
mysqlbinlog mysql-bin.000006 > /root/bbx.log

5、使用新的binlog日志:(更新数据库日志)

复制代码 代码如下:
方法一:[root@bogon mysql]# mysqladmin -uroot -p flush-logs
方法二:mysql> FLUSH LOGS;
方法三:[root@bogon mysql]# /etc/init.d/mysql restart

相关推荐