Announcement

Collapse
No announcement yet.

Backing Up The Database via SSH/Telnet

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Backing Up The Database via SSH/Telnet

    In order to back up your database via SSH or Telnet you will require 2 things:

    1) SSH or Telnet access to your site. You will need to check with your hosting company to see if this is available.

    2) An SSH/Telnet Client, such as PuTTy.

    Open your SSH/Telnet client and log into your website. The command line prompt you will see will vary by OS.
    For most hosting companies, this will bring you into the FTP root folder.

    Type in the following to create a backup in the current directory:

    Code:
    mysqldump --opt -Q -u dbusername -p databasename > backupname.sql
    Or to create a backup in a separate directory (signified by /path/to/) type:

    Code:
    mysqldump --opt -Q -u dbusername -p databasename > /path/to/backupname.sql
    You will be prompted for the database password. Enter it and the database will backup.

    If your hosting company has you on a remote MySQL server, such as mysql.yourhost.com, you will need to add the servername to the command line. The servername will be the same as in your config.php. The command line will be:

    Current directory:

    Code:
    mysqldump --opt -Q -h servername -u dbusername -p databasename > backupname.sql
    Separate directory:

    Code:
    mysqldump --opt -Q -h servername -u dbusername -p databasename > /path/to/backupname.sql
    You can then, if you wish, download the backup to your home computer.

  • #2
    That's something I will use for one server as it's the only HP-UX we have in the network and I need to backup this one on a Windows server. So I will do the SQL backup then pull it from a Windows Server.

    Originally posted by A6er View Post
    In order to back up your database via SSH or Telnet you will require 2 things:

    1) SSH or Telnet access to your site. You will need to check with your hosting company to see if this is available.

    2) An SSH/Telnet Client, such as PuTTy.

    Open your SSH/Telnet client and log into your website. The command line prompt you will see will vary by OS.
    For most hosting companies, this will bring you into the FTP root folder.

    Type in the following to create a backup in the current directory:

    Code:
    mysqldump --opt -Q -u dbusername -p databasename > backupname.sql
    Or to create a backup in a separate directory (signified by /path/to/) type:

    Code:
    mysqldump --opt -Q -u dbusername -p databasename > /path/to/backupname.sql
    You will be prompted for the database password. Enter it and the database will backup.

    If your hosting company has you on a remote MySQL server, such as mysql.yourhost.com, you will need to add the servername to the command line. The servername will be the same as in your config.php. The command line will be:

    Current directory:

    Code:
    mysqldump --opt -Q -h servername -u dbusername -p databasename > backupname.sql
    Separate directory:

    Code:
    mysqldump --opt -Q -h servername -u dbusername -p databasename > /path/to/backupname.sql
    You can then, if you wish, download the backup to your home computer.

    Comment

    Working...
    X