lstellway/mysql-backup-s3

By lstellway

Updated about 2 years ago

Backup MySQL Database(s) to S3 Bucket

Image

303

Backup MySQL Database(s) to S3 Bucket

docker pull lstellway/mysql-backup-s3

Environment Variables

  • BACKUP_DATABASES
    • Comma-separated list of database names to backup.
      (User must have access to specified database)
  • DB_USER
    • Database user
  • DB_PASS
    • Database password
  • DB_PASS_FILE
    • Secret file containing database password
  • DB_HOST(Default: localhost)
    • Database host
  • DB_PORT(Default: 3306)
    • Database port
  • S3_PROTOCOL(Default: https)
    • Protocol used to connect to S3 server
  • S3_REGION(Default: us-east-1)
    • S3 server region
  • S3_BUCKET
    • S3 bucket
  • S3_ENDPOINT
    • S3 endpoint
  • S3_ACCESS_KEY
    • S3 access key
  • S3_ACCESS_KEY_FILE
    • Path to file containing S3 access key
  • S3_ACCESS_SECRET
    • S3 access secret
  • S3_ACCESS_SECRET_FILE
    • Path to file containing S3 access secret

Recommendations

MySQL User

It is recommended to create a MySQL user that only has read permissions on your databases to backup.

CREATE USER '{{DB_USER}}'@'%' IDENTIFIED BY '{{DB_PASS}}';
GRANT LOCK TABLES, SELECT ON {{DB_NAME}}.* TO '{{DB_USER}}'@'%';

Resources

Docker Pull Command

docker pull lstellway/mysql-backup-s3