Flights - Home Loan - Car Credit - Credit Card UK - Cell Phones

PDA

View Full Version : Best way to do a database backup?


rick sample
Oct 15th 2005, 9:19 am
First let me state I have tried utility after utility. I've dowloaded many problems, everyone which seems to can't connect to the database or it'll return an error right before it finishes.

I've just discovered PHPMYADMIN installed on our server. I went to the exports tab, selected to export all in that particluar database and I clicked go to download. Right now it is downloading as one SQL file, is this a good way to download a backup or a bad way? By this I mean if my database were to ever go corrupt, would I just reupload that SQL file and it'll go back to the day I dowloaded that without any problems?

Any advice would be great!

ServerUnion
Oct 15th 2005, 9:47 am
The answer is yes. cPanel if you use it has a good utility to do backups also.

my3cents
Oct 17th 2005, 4:38 pm
If you use MySQL there is a command you can run (or schedule in CRON) to do the backup periodically.

mysqldump myDBname | gzip >/home/backups/mysql_db.gz

This dumps every table of your database into a zipped file format. If you were to try and restore your database, you would just need to "run" the query it created. Basically it is a giant file with CREATE TABLE statements and INSERT statements that rebuilds your entire database from scratch. So you can run it in a completely new database environment, or your existing if necessary.

Good luck!

digitalpoint
Oct 17th 2005, 5:01 pm
Also, if you are using all MyISAM tables, you might want to use mysqlhotcopy (http://dev.mysql.com/doc/refman/5.0/en/mysqlhotcopy.html). (it's faster)