Home >Database >Mysql Tutorial >使用bin-log日志还原数据库的例子_MySQL

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

WBOY
WBOYOriginal
2016-06-01 13:23:461097browse

bitsCN.com

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

bitsCN.com
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn