Re: Database backup

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Just do a mysqldump on the command line. It will dump a whole bunch of SQL code that can be used to recreate the database in the event of disaster. You could even pipe the output to gzip to compress it.

mysqldump --all-databases -u root | gzip -c > mysql_backup.gz

That works fine for me. Then just do this to restore the database from backup:

   gunzip mysql_backup.gz
   mysql -u root < mysql_backup

I recommend putting this in a shell script cron job that stores each backup with the date in the file name.

Enjoy.

--Dave

Chris Payne wrote:

Hi there everyone,

Is there a quick way I can backup all my databases on Linux so I can download them to my HD/Burn them onto CD?

I've started a very large travel project and there is going to be over 100 DB's in the end, each with who knows how many tables and going through PHPMyADMIN and exporting 1 DB at a time is going to take forever.

My Server is the Rehat Linux 8.0 with Apache and MySQL and PHP.

Thanks, any help would be really appreciated (And save me alot of headaches).

Chris



-- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux