Restoring The Database via SSH/Telnet 
In order to restore 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.
Note:
If your database backup resides on your home computer, you will first have to upload it via FTP to your website
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.

You can either change directoties to wherever the backup is located and type in the following:

mysql -u dbusername -p databasename < backupname.sql

Or if you do not want to change directories and you know the path to where the backup is located, type in the following:

mysql -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:

mysql -h servername -u dbusername -p databasename < backupname.sql

Or:

mysql -h servername -u dbusername -p databasename < /path/to/backupname.sql
User Contributed Notes: Restoring The Database via SSH/Telnet Add a Comment
Zachery Woods 23rd May 2005, 12:55am
For anyone doing restores or dumps from windows, you must remember that 90% of the time that an Admin will not update the path in windows, so you will need to be directly inside of the mysql\bin dir or use a full path to your mysql.exe and mysqldump.exe files.

After that its normal operation from there.

eg: c:\mysql\bin>mysqldump --opt -uUSER -pPASSWORD database > c:\inetpub\database.sql
Add a Comment