How to backup your MySQL database fromSSH

mysqldump --opt -u your_database_username -p your_database_name > backup.sql

It will then prompt for your password to the database. Depending on the size of the database this can take seconds to hours, so be patient. It isn’t just sitting there. Once it’s completed, you can check the size of the raw database, by using this command:
Code:

ls -al backup.sql

The easiest way to get the size down is to gzip the file:
Code:

gzip backup.sql

You can then download the file by whatever method you wish. Probably FTP is the best if it’s in a private directory. If you have to change hosts, you can upload the backup.sql.gz file you’ve created, and restore it as follows. First, unzip the compressed file:
Code:

gzip -d backup.sql.gz

Then, assuming you’ve created a MySQL username & database, you can restore with the following:
Code:

mysql -u your_database_username -p your_database_name < backup.sql

It’s really that simple. A lot faster, no file limitations, and no phpMyAdmin required!

No comments:

re-Tweets by Balaji

ఆకాశ గంగ

Online Movies - SmartDesis

Keyword Density Ckecking Tool

This tool will crawl the given URL and Analyzes the density of the keywords.

Keyword Density Checker

Enter a URL to analyze