新需求
- 只cp ibd文件器躏,可以當(dāng)成備份嗎刺彩;
知識(shí)點(diǎn)
-
數(shù)據(jù)一致性問題:
- cp備份需要mysql下線停止服務(wù)豌鸡;
-
mysql 8, innodb引擎潜必,物理數(shù)據(jù)存儲(chǔ)文件關(guān)系
- ibdata1: 數(shù)據(jù)字典信息;
- ib_logfile0, ib_logfile1: redo日志魂仍,transaction日志拐辽;
- ibtmp1: 臨時(shí)表空間磁盤文件,臨時(shí)表擦酌;
- undo_001: undo日志俱诸;
- frm: 8.0開始取消了,列信息放在 serialized dictionary information (sdi)赊舶,并保存在ibd文件中睁搭;
- ibd: 表的數(shù)據(jù)行或索引;
-
mysql 5.7, innodb引擎锯岖,物理數(shù)據(jù)存儲(chǔ)文件關(guān)系 (區(qū)別)
- ibdata1: 數(shù)據(jù)字典信息介袜,undo表空間甫何;
- frm: 存儲(chǔ)表的信息列出吹;
-
通過上面知識(shí),我們知道辙喂,只cp ibd文件是不夠的捶牢;
- 5.7上鸠珠,show schema可以顯示,table也可顯示,無法查詢數(shù)據(jù)秋麸;
- 在8.0上渐排,cp 后show schema后無此db,更嚴(yán)謹(jǐn);
課程視頻
mysql_coldknowlegde_lesson1 on bilibili
mysql_coldknowlegde_lesson1 on xigua