Skip to content

Instantly share code, notes, and snippets.

@MitsunChieh
Created November 30, 2015 07:04
Show Gist options
  • Save MitsunChieh/d333441a6812c4045e6c to your computer and use it in GitHub Desktop.
Save MitsunChieh/d333441a6812c4045e6c to your computer and use it in GitHub Desktop.
backup mysql on server
# 資料庫備份
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