Created
November 30, 2015 07:04
-
-
Save MitsunChieh/d333441a6812c4045e6c to your computer and use it in GitHub Desktop.
backup mysql on server
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 資料庫備份 | |
mysqldump -u[user] -p -P[port] -h[host] db_name > back_up.sql | |
# 資料庫備份,但排除特定資料表 | |
mysqldump -u[user] -p -P[port] -h[host] db_name --ignore-table=db_name.table_name > back_up.sql | |
# 壓縮成 tgz | |
tar zcf filename.tgz filename1 filename2 | |
# 解壓縮從 tgz | |
tar zxf filename.tgz |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment