[mythtv-users] Backing up mysql database.

David Brodbeck gull at gull.us
Wed Sep 5 17:07:59 UTC 2007

On Sep 4, 2007, at 11:13 PM, clemens at dwf.com wrote:

> Is there any advantage in using one of the mysql backup programs over
> just taring up /var/lib/mysql/mysql and /var/lib/mysql/mythconverg ?

To get a consistent backup that way you need to make sure no changes  
are written to the tables during the copy.  If you want to use this  
approach, take a look at mysqlhotcopy.  It locks the tables before  
doing the copy.  Once mysqlhotcopy has copied the table files, you  
can use tar or whatever else you want to back up the copies.

mysqldump is superior for reasons that have already been mentioned,  
but sometimes mysqlhotcopy is more practical because it's  
considerably faster.  This minimizes the interruption for other  
programs using the database.  In another, non-MythTV application, I  
use this method to make nightly backups of a 40 gigabyte MySQL database.

If you do use mysqldump, a tip -- the resulting text files compress  
*very* tightly with gzip.  I've seen compression ratios approaching  
10:1 on dump files, because so much of the text is duplicated.

More information about the mythtv-users mailing list