Created
March 1, 2016 11:42
-
-
Save dharma017/e71d6dc069e7cd9b1ec5 to your computer and use it in GitHub Desktop.
Bash: Download MySQL database from cPanel to development server
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
| #!/bin/bash | |
| # This is a script I used to download my live site database onto my development | |
| # server when I used a web host that used cPanel, but didn't give me access to | |
| # mysqldump over SSH (because they had Jailshell enabled). | |
| # Note: The database name (DBNAME) excludes the account name prefix - i.e. | |
| # "dbname" not "sitename_dbname". | |
| curl http://USERNAME:PASSWORD@HOSTNAME:2082/getsqlbackup/DBNAME.sql.gz \ | |
| | gunzip \ | |
| | mysql LOCAL_DBNAME |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment