Skip to content

Instantly share code, notes, and snippets.

@dharma017
Created March 1, 2016 11:42
Show Gist options
  • Select an option

  • Save dharma017/e71d6dc069e7cd9b1ec5 to your computer and use it in GitHub Desktop.

Select an option

Save dharma017/e71d6dc069e7cd9b1ec5 to your computer and use it in GitHub Desktop.
Bash: Download MySQL database from cPanel to development server
#!/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