How to backup and restore large mysql database
Since my shopping cart getting bigger and bigger, backup become one of the big issues with my current shopping cart. So, I decided using ssh to directly backup the database.
First, you need to has ssh access and using putty log into the server.
second, local the folder that allow you to using you ftp program to download the file.
third, run the following command
mysqldump --add-drop-table -u db_username -p db_name > mybackup.sql
db_username = database username
db_name = database name
mybackup.sql = the backup file name.
if you want to gzip your file, follow the following simple
mysqldump –opt -u [user_name] -p [database_name] | gzip > [backup_file].dump.gz
restore database command as follow
$ mysql -u username -p databasename < database.sql
I think it is easier if you have ssh to backup and using wget command download from one server to the other to run the backup.