Created
December 3, 2016 20:02
-
-
Save Kein1945/1b255a1b7001670ea8fc9ad265a410c3 to your computer and use it in GitHub Desktop.
Allow copy remote database to local mysql database throw ssh
This file contains hidden or 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
#!/usr/bin/bash | |
mysql -u user -e 'DROP DATABASE IF EXISTS db_dev; CREATE DATABASE db_dev;' | |
ssh hlts -C -o CompressionLevel=9 'mysqldump -udeploy --password=password \ | |
--skip-lock-tables \ | |
crm | gzip -9 -c' | gunzip | mysql -u root db_dev |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment