Last active
July 23, 2021 14:28
-
-
Save januszm/df15ae855e210d09e87acd8820beea1a 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
#!/bin/bash | |
# -d for no data, just structure | |
# -t for no create, just data | |
# --ignore-table=name1 --ignore-table=name2 | |
# --skip-comments | |
# include table names after DATABASE | |
mysqldump -u USER -h HOST -p DATABASE | gzip > DATABASE.sql.gz | |
# load | |
zcat DATABASE.sql.gz | mysql -u USER -p DATABASE | |
# or | |
gunzip < DATABASE.sql.gz | mysql -u USER -p DATABASE | |
# or with progressbar | |
pv DATABASE.sql.gz | gunzip | mysql -u USER -p DATABASE | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment