Created
May 12, 2018 07:05
-
-
Save ethaizone/feff6f5290e58afba78cc51dc546c67e to your computer and use it in GitHub Desktop.
MySQL - Dump and import with GZip
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
# Export | |
mysqldump -u root -p your_db | gzip -c > your_db_2018-05-12.sql.gz | |
# Export with datetime in filename | |
mysqldump -u root -p your_db | gzip -c > your_db_$(date +%Y-%m-%d-%H.%M.%S).sql.gz | |
# Import | |
zcat your_db_2018-05-12.sql.gz | mysql -u root -p your_db |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment