可以通過MySQLdump –help 查看詳細(xì)幫助 -d 表示只導(dǎo)出結(jié)構(gòu) -t 表示只導(dǎo)出數(shù)據(jù) –single-transaction 我們可以控制備份導(dǎo)出時,操作在同一事務(wù)中,來達(dá)到備份數(shù)據(jù)的一致性和完整 性 –lock-tables 表示導(dǎo)出備份時只能鎖定一個庫 –lock-all-tables 需要 dump 的表分別在多個不同的數(shù)據(jù)庫中,一定要使用“–lock-all-tables”才能確保數(shù)據(jù)的一致完整性。
1.導(dǎo)出數(shù)據(jù)庫 mysqldump –lock-all-tables ximilo_server -u用戶名 -p密碼 數(shù)據(jù)庫名> ximilo_server.sql 若提示 Using a passWord on the command line interface can be insecure.其實數(shù)據(jù)已經(jīng)導(dǎo)出到當(dāng)前命令所在目錄 導(dǎo)出指定表 mysqldump –lock-all-tables ximilo_server 表名1 表名2
新聞熱點
疑難解答
圖片精選