Mysql Backup from Shell

Posted by admin in Internet, Tutorials,... | 09.03.2006 - 5:31 am

Backing up your database is important, here is a simple tutorial to backup your mysql database from shell using the mysqldump command. :)
The things you must know are:-

  • Webhosting Username
  • Webhosting Password
  • Webserver address
  • Mysql Username
  • Mysql Ppassword
  • Name of the database you want to backup

First you need to connect to your websever through the telnet client.

To open Telnet, Goto Start Menu>Run, type telnet in the box and hit OK.

Then select Connect>Remote System from the Telnet menu. Type your host address in the Hostname. Select port as Telnet and select Term Type as vt100. Then click Connect.

Next your webhosting server will ask for login username and password, type your hosting username and password. After successful login you will see a welcome message from your webhost.

Now first create a new folder where you want to save your backup. Give command mkdir db_backups (without quotes). This will create a new folder with name db_backups in the root of your webhosting account.

Now you can use the mysqdump command to dump your database backup into that folder.

The command syntax to backup your mysql database using mysqldump is as given below:-

mysqldump -uUsername -pPassword -h hostname dbname >dbname.sql

For Ex:-

  • If your mysql username= tiger
  • Mysql password = tiger123
  • Mysql hostname = localhost
  • Database name = tigers_site
  • Backup folder = db_backups

The command will be:-

mysqldump -utiger -ptiger123 -h localhost tigers_site >db_backups/backup.sql

This will dump the backup file backup.sql to the folder db_backups.

You can read more about mysqldump here. :D

Technorati Tags: , , ,

If you enjoyed this post, make sure you subscribe to my RSS feed!

Related Posts:
  • Do you Backup your Blog Database ?
  • Get Wordpress DB Backup in Your Mailbox
  • Best Posts from 2006
  • WordPress Plugin for Automatic Backups

  • No Comments on "Mysql Backup from Shell" »

    No comments yet.

    Leave a comment


    Close
    E-mail It