Created
August 24, 2016 22:27
-
-
Save bogutski/09c1e1c5655105362e754aa6640e6ffd to your computer and use it in GitHub Desktop.
Bash script for import from local MySQL database to remote DB through SSH
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
lclDBName="value" | |
lclDBUser="value" | |
lclDBPass="value" | |
RemoteDBName="value" | |
RemoteDBUser="value" | |
RemoteDBPass="value" | |
RemoteHost="localhost" | |
lclHost="localhost" | |
RemoteSSHUser="value" | |
RemoteSSHIP="11.111.111.11" | |
mysqldump --host=$lclHost --user=$lclDBUser --password=$lclDBPass $lclDBName | ssh $RemoteSSHUser@$RemoteSSHIP mysql --user=$RemoteDBUser --password=$RemoteDBPass --host=$RemoteHost $RemoteDBName |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment