[mythtv-users] Mysql backup

Chris Petersen lists at forevermore.net
Fri Mar 12 11:13:31 EST 2004


> My question is how can I back up my mysql database - I have a 2nd drive that is for data only. I don't know if the service is running as even the loop-back address is dead.

service mysqld stop
tar jcf mysql.tar.bz2 /var/lib/mysql
service mysqld start

You can do this without stopping mysql, but you risk a corrupted archive
if the database is written to during the tar (we do this at work for a
system that can't be stopped, and I'd say about 1 in 10-20 hourly
backups gets corrupted)

to restore, just copy back to /var/lib/

All this, of course, is assuming that mandrake stores things in the same
place as redhat and the official mysql rpm.

-- 
Chris Petersen
Programmer / Web Designer
Silicon Mechanics:  http://www.siliconmechanics.com/
Blade Servers:      http://www.siliconmechanics.com/c292/blade-server.php
1U Servers:         http://www.siliconmechanics.com/c272/1u-server.php




More information about the mythtv-users mailing list