Creating a full MariaDB backup

For some reason I have had a time finding succinct information on creating a simple full (and by full I mean a file you can use to bare metal recover a database) backup with MariaDB.

1. Make a ~/.my.conf file:

[mysqldump]
user=<your_database>
password=<your_password>

2. Run this:

mysqldump --add-drop-table -h server_ip database_name  | pv | gzip -9 > /tmp/backup.sql.tar.gz

3. Copy your newly created backup file to a secondary storage point.

4. Enjoy!

Leave a Reply