MySQL Backup And Recovery With mysql-zrm On Debian Sarge - Page 2

3 Basic Configuration

The main configuration file is /etc/mysql-zrm/mysql-zrm.conf. In this file we have to specify at least the MySQL-backup user (a MySQL user with all privileges, like root) and his password:

vi /etc/mysql-zrm/mysql-zrm.conf


If nothing else is specified, mysql-zrm assumes default values for all other settings. With this configuration, mysql-zrm would do backups of all databases, in raw format, it would keep the backups forever, and it wouldn't send email notifications.

Raw format means, it backs up the databases as binary files that can be copied back to the database in case of loss of data, but it can cause problems if you copy these files between different MySQL versions.

The counterpart of the raw format is the logical format which creates text files with a plain SQL dump of your databases. These SQL dumps can be restored in almost all MySQL versions, and you could even do it manually, as shown here:

If you want to get email notifications to your email address, add this to /etc/mysql-zrm/mysql-zrm.conf:

vi /etc/mysql-zrm/mysql-zrm.conf


If you want to make backups in logical format and want to keep backups for seven days (instead of forever), add these lines to /etc/mysql-zrm/mysql-zrm.conf:

vi /etc/mysql-zrm/mysql-zrm.conf

# allowed values for backup-mode are "raw" and "logical"

If you want to make a backup of a MySQL replication slave, add this line to /etc/mysql-zrm/mysql-zrm.conf:

vi /etc/mysql-zrm/mysql-zrm.conf


This will back up files that are important for a MySQL replication slave.

If you want to back up only the databases exampledb and anotherexampledb instead of all databases, add this to /etc/mysql-zrm/mysql-zrm.conf:

vi /etc/mysql-zrm/mysql-zrm.conf

databases=exampledb anotherexampledb

If you only need backups of the tables text, user, and page from the exampledb database, add this to /etc/mysql-zrm/mysql-zrm.conf:

vi /etc/mysql-zrm/mysql-zrm.conf

tables=text user page

Please note: the settings all-databases, databases, and tables/database are mutually exclusive!

The default /etc/mysql-zrm/mysql-zrm.conf comes with lots of comments that explain all configuration options. I'm using these settings for now:

vi /etc/mysql-zrm/mysql-zrm.conf

# all-databases=1 is optional, as it is the default setting
Share this page:

5 Comment(s)

Add comment


From: Bluedog at: 2006-10-04 21:02:39

Great how-to.  I'm boomarking this to share with all my DBAs.

From: curx at: 2006-10-08 00:57:33


precreated debian package can be found at


From: at: 2007-08-01 16:18:34

Packages are available at:

(Debian) I found that after installing the version 1.2 .deb package, I got errors like this:

gzip: /usr/share/man/man5/mysql-zrm-reporter.conf.5.gz: Permission denied
mandb: command '/bin/gzip -dc /usr/share/man/man5/mysql-zrm-reporter.conf.5.gz'
failed with exit status 256
mandb: warning: /usr/share/man/man5/mysql-zrm-reporter.conf.5.gz: bad symlink or
ROFF `.so' request

So, try this to correct it:

chown root:root /usr/share/man/man5/mysql-zrm*
chown root:root /usr/share/man/man1/mysql-zrm*
chmod 644 /usr/share/man/man5/mysql-zrm*
chmod 644 /usr/share/man/man1/mysql-zrm*

From: music01 at: 2009-12-30 14:34:12

for the incremental Backup using the ZRM Community edition, ensure that you have installed the zrm client rpm on the server  in which you need the incremental backup

From: Anthony at: 2013-04-11 17:14:32

You mentioned that running didnt work right:

mysql-zrm --action parse-binlogs --source-directory=/var/lib/mysql --backup-set dailyrun

Well you need to make


 That will result with alot of output if its a large db backup. So this is NOT referring to bin-log directory.