好湿?好紧?好多水好爽自慰,久久久噜久噜久久综合,成人做爰A片免费看黄冈,机机对机机30分钟无遮挡

主頁 > 知識庫 > 如何用mysqldump進行全量和時間點備份

如何用mysqldump進行全量和時間點備份

熱門標簽:地圖標注客戶付款 石家莊400電話辦理公司 咸陽防封電銷卡 申請400電話電話價格 臨沂做地圖標注 許昌外呼增值業(yè)務(wù)線路 宜賓全自動外呼系統(tǒng)廠家 廣東400企業(yè)電話申請流程 新鄉(xiāng)智能外呼系統(tǒng)好處

mysqldump在mysql中用于邏輯備份,雖然速度不快,但非常靈活,有很多功能,靈活使用的化絕對是利器。

首先思考一個問題,mysql為什么要備份,主要還是數(shù)據(jù)安全性,比如主庫掛了,數(shù)據(jù)不小心被刪除了,所以全量備份非常重要。

是從主庫還是副庫進行全量備份呢?

1:從主庫

主庫比較重要,但其實備份的時候并不會影響數(shù)據(jù)庫

mysqldump --host= --user= --password= --single-transaction --master-data=1 --flush-logs --databases >~/db.log

—single-transaction 參數(shù)能夠報紙一致性讀,不會鎖表,也就是備份的時候不影響數(shù)據(jù)更新。

it dumps the consistent state of the database at the time when START TRANSACTION was issued without blocking any applications.

因為一致性讀,能夠保證coordinates點的位置,即使備份時間很久,也能得出正確的同步位置點。

While a —single-transaction dump is in process, to ensure a valid dump file (correct table contents and binary log coordinates)

—master-data參數(shù)也很重要,導出的語句會包含CHANGE MASTER TO語句,包括備份語句同步到的二進制文件和位置點。

Use this option to dump a master replication server to produce a dump file that can be used to set upanother server as a slave of the master. It causes the dump output to include a CHANGE MASTER TO statement that indicates the binary log coordinates (file name and position) of the dumped server. These are the master server coordinates from which the slave should start replicating after you load the dump file into the slave.

—flush-logs會強制重新生成一個新的二進制文件,這樣恢復的時候會比較方便。

2:從副庫

感覺上從副庫備份更安全。

mysqldump --host=--user= --password= --dump-slave=1 --flush-logs --apply-slave-statements --include-master-host-port --databases >~/db.log;

— dump-slave和—master-data參數(shù)很類似:

This option is similar to —master-data except that it is used to dump a replication slave server to produce a dump file that can be used to set up another server as a slave that has the same master as the dumped server. It causes the dump output to include a CHANGE MASTER TO statement that indicates the binary log coordinates (file name and position) of the dumped slave's master. These are the master server coordinates from which the slave should start replicating.

記住一點它獲取的是主庫的bin log coordinates(不是備份庫的)

—dump-slave causes the coordinates from the master to be used rather than those of the dumped server

dump出來的語句會包含 — Position to start replication or point-in-time recovery from。

—apply-slave-statements會讓dump語句中自動包含start和stop slave語句。—include-master-host-port包含主庫的連接信息。

必須記住一點,即使有—single-transaction語句,—dump-slave也會暫停mysql同步,也就是備份庫的數(shù)據(jù)是落后于主庫的,所以一般自動化腳本在備份的時候會先摘除備份庫。

This option causes mysqldump to stop the slave SQL thread before the dump and restart it again after.

3:如何進行時間點恢復

沒有實戰(zhàn)過,首先基于最近的一次全量備份進行恢復,然后將后續(xù)的binlog文件導入(如果這些文件還在的話),所以副庫最好也備份binlog語句。

如果數(shù)據(jù)被誤刪除了,將備份點(—flush-logs發(fā)揮作用了)到今天凌晨的binlog語句導入進來,或者找到安全的binlog位置點進行恢復。至于如何跳過“危險語句”是比較難控制的。

以上就是如何用mysqldump進行全量和時間點備份的詳細內(nèi)容,更多關(guān)于mysqldump進行全量和時間點備份的資料請關(guān)注腳本之家其它相關(guān)文章!

您可能感興趣的文章:
  • mysqldump你可能不知道的參數(shù)
  • MySQL5.7 mysqldump備份與恢復的實現(xiàn)
  • linux使用mysqldump+expect+crontab實現(xiàn)mysql周期冷備份思路詳解
  • MySql使用mysqldump 導入與導出方法總結(jié)
  • MySQL之mysqldump的使用詳解
  • docker 使用mysqldump命令備份導出項目中的mysql數(shù)據(jù)
  • MySQL數(shù)據(jù)遷移使用MySQLdump命令
  • PHP定時備份MySQL與mysqldump語法參數(shù)詳解
  • mysql備份腳本 mysqldump使用方法詳解
  • 詳解 linux mysqldump 導出數(shù)據(jù)庫、數(shù)據(jù)、表結(jié)構(gòu)
  • 詳談mysqldump數(shù)據(jù)導出的問題
  • MySQL官方導出工具mysqlpump的使用

標簽:阜新 北京 鷹潭 合肥 鎮(zhèn)江 日照 貴州 臺灣

巨人網(wǎng)絡(luò)通訊聲明:本文標題《如何用mysqldump進行全量和時間點備份》,本文關(guān)鍵詞  如,何用,mysqldump,進行,全量,;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問題,煩請?zhí)峁┫嚓P(guān)信息告之我們,我們將及時溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無關(guān)。
  • 相關(guān)文章
  • 下面列出與本文章《如何用mysqldump進行全量和時間點備份》相關(guān)的同類信息!
  • 本頁收集關(guān)于如何用mysqldump進行全量和時間點備份的相關(guān)信息資訊供網(wǎng)民參考!
  • 推薦文章
    主站蜘蛛池模板: 日本一道无卡不码高清A片| 免费看男女做黄的软件| 99精品国产高清一区二区三区香蕉 | 暴露调教女友小月| 被男同桌掀裙子扒内裤摸屁股 | 国产成人精品久久久久大片| 欧美激情性xxxxx漫画卡通| 亚洲一区二区嗯好爽快点 | 欧美日韩三点式内衣| 日本A片无码少妇a 6 2电视剧| 中文字幕一区婷婷久久| 免费很黄很暴力的视频| 扒开女人猛进女人下面的视频| 亚洲熟伦熟女专区HD高清| 在线理伦片在线理伦片在| 在线中文字幕精品第一页| 陛下爽?躁多水?快?深点小说| 少妇富婆推油偷人A片| 色噜噜狠狠色综合久| 丝袜黄色片| 亲戚乱系列合集| 韩国二区| 老司机午夜私人影院免费| 把孕妇爽到高潮孕妇| 女仆扒开腿秘?让男人玩| 最新最好的电视| 丫头给我| 国产亚洲精品久久久久久777 | 男人天堂va| 村长又粗又长弄死我了| 美女打屁股内裤都脱了动态图| 白丝jk爆??乳?| 精品一区二区AV天堂色偷偷| 国产成人19禁在线观看| 欧美午夜性春猛交| 三上悠亚在餐厅那一部番号| 足疗店卖婬一区二区三区| 91精品国产综合久久久蜜臀粉嫩| 波多野结衣激情| 乳娘葡萄多汁| 美女扒开尿口给男人捅|