🎉 Happy News! The new website is out :-) Google

mysql-backup

mysql-backup

Automated MySQL and MariaDB backup with per-table or full-database dumps, gzip compression, configurable retention and S3 upload. Companion script to pg-backup.

Installation

bpkg install luislavena/mysql-backup

Usage

# Full database backup
mysql-backup --host localhost --db myapp --user root

# Per-table dumps (easier partial restores)
mysql-backup --db myapp --per-table

# With S3 and 14-day retention
mysql-backup --db myapp --s3-bucket my-backups --retain 14

Configuration

MYSQL_HOST=localhost
MYSQL_PORT=3306
MYSQL_DB=myapp
MYSQL_USER=backup
MYSQL_PASSWORD=secret
S3_BUCKET=my-backups
BACKUP_RETAIN_DAYS=14

Restore

# Restore full dump
mysql-backup restore myapp_2024-03-10.sql.gz

# Restore single table
mysql-backup restore myapp_users_2024-03-10.sql.gz