Created
August 21, 2016 14:11
-
-
Save simonqian/156757ec4a1e9b61353c7d2f49c98595 to your computer and use it in GitHub Desktop.
This file contains 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
1. 备份数据库并压缩 | |
mysqldump -h -u -p database | gzip > backupfile.sql.gz | |
2. 解压并还原数据库 | |
gunzip < backupfile.sql.gz | mysql -uroot -ppassw database | |
真实例子(带参数) | |
mysqldump --complete-insert --no-create-info --skip-triggers --ignore-table=cellar.schema_migrations --ignore-table=cellar.regions -uroot -p cellar | gzip > backupfile.sql.gz | |
gunzip < backupfile.sql.gz | mysql -ucellar -p cellar |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment