mysql的增量備份

來源:互聯網
上載者:User

標籤:修改   .net   www.   http   目錄   步驟   切換   安裝   varchar   

1,在mysql 的my.ini檔案中

2在我的D盤下建立binlog檔案夾

3重啟mysql服務可以看到我的D盤下的binlog下產生如下檔案

4,在預設的test資料庫中建立t_one1這張表
 create table t_one1(id

www.baohuayule.cn 

varchar(10),name varchar(2));
4.1插入幾條資料,然後能看到wxzlog.000001這個檔案的修改日期變化了,這個檔案就是我們對資料庫進行增刪改的記錄,對查詢不做記錄,我們可以使用mysql
內建的mysqlbinlog進行查看
4.2把t_one1這張表給刪了,然後我們執行一下步驟進行恢複

5在cmd中切換到你安裝mysql的bin目錄下如

 

6,進行查看mysqlbinlog d:www.wanmeiyuele.cn \binlog\wxzlog.www.leyouzaixan.cn 000001,則可以看到如我截取的一部分

1,是時間
2,是位置
我們可以使用時間和位置兩種方式進行恢複
命令如下:
使用位置恢複
mysqlbinlog --stop-position="2137" d:www.baohuayule.com  \binlog\wxzlog.000001 | mysql -uroot -p
使用 時間恢複
mysqlbinlog --stop-datetime="2018-04-20 13:39:11" d www.huayu1178.cn :\binlog\wxzlog.000001 | mysql -uroot -p
恢複某一時間段的資料
mysqlbinlog --start-datetime="2018-04-20 13:32:13"   www.yszx11.cn/ --stop-datetime="2018-04-20 www.006665.cn 13:39:11" d:\binlog\wxzlog.000001 |

mysql的增量備份

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.