Last active
April 21, 2016 10:02
-
-
Save pokka/c309721ede49c59cd39a to your computer and use it in GitHub Desktop.
mysql dump & import
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
#import | |
gunzip < backupfile.sql.gz | mysql -uroot -ppassw database | |
#dump | |
mysqldump -h -u -p database | gzip > backupfile.sql.gz | |
#dump without schema(data only) | |
mysqldump --no-create-info --skip-triggers -h -u -p database | gzip > backupfile.sql.gz | |
#dump with columns | |
mysqldump --complete-insert --no-create-info --skip-triggers -h -u -p database | gzip > backupfile.sql.gz | |
#--ignore-table=database | |
mysqldump --complete-insert --no-create-info --skip-triggers --ignore-table=database.table -u -p database | gzip > backupfile.sql.gz | |
--set-gtid-purged=OFF | |
--skip-lock-tables | |
#with pv | |
mysqldump |pv| gzip -c > backupfile.sql.gz |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment