Backups and MySQL

Associate
Joined
27 Apr 2004
Posts
2,377
I've just setup a backup system for my server using rsync, that backs up the whole filesystem. However, I'm not sure about MySQL - my question is, if the files stored on disc are safe, can they be reloaded into a new MySQL setup if necessary, or should I be exporting them into some other format for backup?

This is on Debian Etch btw.

Thanks, null :)
 
Thanks for the reply Beansprout :) I've had a play and came up with this:

mysqldump --all-databases --user root --password=password > /home/user/mysqlbackup.sql

I then made an entry in cron by running crontab -e, to run that command at 1am daily - just before the filesystem backup runs. Does this all look good or have I made mistakes? (Still very new to Linux).

Thanks, null :)
 
Put this into a cron for the time you want. The gzip bit will give you a smaller backup file...100MB raw mysql will be something like 20MB as gzip :)

mysqldump -username -password databasename | gzip > /home/username/mysqlbackup.sql.gz

Dan
 
Back
Top Bottom