1. 程式人生 > >RDS資料庫全量恢復方案

RDS資料庫全量恢復方案

一。全量恢復

 恢復最近的快照,將快找之前的資料全量恢復

二。增量恢復

下載對應的binlog日誌匯入到資料庫

三。還沒有備份的binlog日誌獲取方法

首先連線 RDS for MySQL 後檢視當前的 binlog 檔案,可以通過下面命令:

show binary logs;

通過 --read-from-remote-server 引數實現遠端讀取並儲存到本地的 a.sql 檔案中

mysqlbinlog  -umolan -p -hffffffffffffff.mysql.rds.aliyuncs.com --read-from-remote-server mysql-bin.000497
>a.sql

binlog_format=row時,用mysqlbinlog想檢視二進位制日誌時需要加上-v引數。

mysqlbinlog  -umolan -p -hffffffffffffff.mysql.rds.aliyuncs.com -v --read-from-remote-server mysql-bin.000497 >a.sql