Quick start


Linux, BSD, OSX

$ wget https://github.com/cytopia/mysqldump-secure/archive/0.16.3.tar.gz -O - | tar -xz
$ cd mysqldump-secure
$ ./configure
$ make
$ sudo make install


$ brew tap cytopia/tap
$ brew install mysqldump-secure


Set mysql username and password.
When installed via homebrew the location might be /usr/local/etc/mysqldump-secure.cnf.

$ vim /etc/mysqldump-secure.cnf

host = localhost
user = user
password = "password"

Adjust configuration.
When installed via homebrew the location might be /usr/local/etc/mysqldump-secure.conf.

$ vim /etc/mysqldump-secure.conf

Verify settings

The --test option will take care about all file and folder permission and will also create missing files or folders.

$ sudo mysqldump-secure --test
[WARN] Logfile does not exist in /var/log/mysqldump-secure.log
[INFO] Trying to create...OK
[WARN] Logfile has wrong permissions: 0644, should be: 0600
[INFO] Trying to chmod to 0600...OK
[INFO] Using config: /etc/mysqldump-secure.conf
[INFO] (OPT) Logging enabled: /var/log/mysqldump-secure.log
[INFO] Running tests only (--test).
[WARN] Destination dir /var/mysqldump-secure does not exist
[INFO] Trying to create... Done
[WARN] Destination dir has wrong permissions: 0755, should be: 0700
[INFO] Adjusting file permissions to 0700 on /var/mysqldump-secure
[INFO] MySQL connection test successful.
[INFO] (OPT) Compression enabled: Using gzip -9 --stdout
[INFO] (OPT) Encryption disabled
[INFO] (OPT) Deletion disabled
[INFO] (OPT) Nagios plugin log disabled
[INFO] Backup directory: /shared/backup/databases
[INFO] Exiting program from test mode (--test).


Normal mode

$ sudo mysqldump-secure

Cron mode

$ sudo mysqldump-secure --cron

Different config

$ sudo mysqldump-secure --conf=/root/mysqldump-secure.conf

Cron with different config

$ sudo mysqldump-secure --cron --conf=/root/mysqldump-secure.conf