https://github.com/softonic/mysql-backup
Backup mysql to aws s3
https://github.com/softonic/mysql-backup
mysql mysqldump s3
Last synced: about 1 year ago
JSON representation
Backup mysql to aws s3
- Host: GitHub
- URL: https://github.com/softonic/mysql-backup
- Owner: softonic
- License: other
- Created: 2019-02-14T17:40:36.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2022-01-11T09:31:52.000Z (over 4 years ago)
- Last Synced: 2025-03-24T19:39:47.257Z (about 1 year ago)
- Topics: mysql, mysqldump, s3
- Language: Shell
- Size: 10.7 KB
- Stars: 1
- Watchers: 7
- Forks: 9
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: CODEOWNERS
Awesome Lists containing this project
README
# Mysql backup s3
## Description
Easily back up from cloudSQL or any mysql instance to AWS S3.
| Variable | Description |
|-----------------------------------|--------------------------------------|
| `MYSQL_HOST` | Mysql host |
| `MYSQL_PORT` | Mysql port |
| `MYSQL_DATABASE` | Mysql target databases. |
| | Space-separated if more than one db, |
| | e.g. MYSQL_DATABASE="db-1 db-2 db3". |
| | If empty or not defined - will try |
| | to dump all databases by using |
| | mysqldump --all-databases flag |
| `MYSQL_USER` | Mysql user |
| `MYSQL_PASSWORD` | Mysql password |
| `AWS_ACCESS_KEY_ID` | AWS S3 accessKeyId |
| `AWS_SECRET_ACCESS_KEY` | AWS S3 secretAccessKey |
| `AWS_S3_FILE_PREFIX` | Prefix to generate AWS s3 file name |
| `AWS_S3_BUCKET` | Target S3 bucket |
| `AWS_ENDPOINT_URL` | Override S3 URL with the given URL |
| `GOOGLE_APPLICATION_CREDENTIALS` | GCP json credentials file path |
| | You can mount this file as container |
| | volume |
| `GCP_GCS_FILE_PREFIX` | Prefix to generate GCP gcs file name |
| `GCP_GCS_BUCKET` | Target GCS bucket |
```bash
docker run -e MYSQL_HOST=mysql -e MYSQL_PORT=3306 -e MYSQL_USER=user -e MYSQL_PASSWORD=pwd -e MYSQL_DATABASE=mydb -e AWS_S3_FILE_PREFIX=s3prefix -e AWS_S3_BUCKET=mybucket --rm softonic./mysql-backup-s3
```