Created
February 12, 2015 14:34
-
-
Save jkischkel/d9c45dfbd22bbe43d58a to your computer and use it in GitHub Desktop.
mysqldump
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
# create uncompressed dump | |
mysqldump -u root --databases soundcloud_test > dump.sql | |
mysql -u root < dump.sql | |
# create compressed dump | |
mysqldump -u root --databases soundcloud_test | gzip > dump.sql.gz | |
gunzip < dump.sql.gz | mysql -u root | |
# create csv files | |
## with column names | |
mysql -B -u root -D soundcloud_test -e "select * from app_tags" | tee table.csv | |
## without column names | |
mysql -B --skip-column-names -u root -D soundcloud_test -e "select * from app_tags" | tee table.csv | |
# setup cron job | |
crontab -e | |
*/1 * * * * /usr/local/bin/mysqldump -u root --databases soundcloud_test > /Users/jankischkel/tmp/dump.sql |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment