mysql 恢复备份

1.在my.cnf 文件中增加以下配置

log-bin=/var/lib/mysql/mysql-binlog
log-bin-index = /var/lib/mysql/mysql-binlog

2. 按时间进行日志恢复

mysqlbinlog --stop-datetime="2015-09-20 22:40:00" /var/lib/mysql/mysqlbinlog.000001| mysql -u root -p

3.全量恢复 

mysqlbinlog --no-defaults /lost+found/mysql_newbak/mysql-binlog.000001| mysql -u root -p

 

 

http://lampblog.org/1474.html

http://www.linuxidc.com/Linux/2012-09/70815.htm

posted @ 2015-09-20 23:19  雍洲无名  阅读(197)  评论(0编辑  收藏  举报