Oracle Blog

MySQL Enterprise Backup

Cloud storage for MySQL Enterprise Backup (MEB) users

Jothir wrote great blog post, introducing MEB's "Backup to Cloud" feature. And while this blog post is great source of information for Amazon users who consider using MEB it is not so clear how to setup the cloud storage itself for those MEB users who are only considering storing backups in the Cloud. I actually was one of them and decided to share my experience.

A bucket where backup image will be stored. To create it, choose S3 service under "Services" menu, then click "Create Bucket" button and enter the name. You will pass this name to --cloud-bucket option.

Access key and secret access key for a user which will connect to AWS. You can use root user for such purpose or create a special one. Latter option is the safest. To create a user choose "AIM" service, then "Manage Users" under "Create individual AIM users" tab, then click "Create new users" and enter user names. After you created a user you will have an option to see its security credentials. It will be somethiing like this:Access Key ID:AKIAJ2DK2OBDEGQSBGSQSecret Access Key:5JJ9O7kQNySY+qhyDHcNIIPr7pY34aWYTAQc/kr/You will pass "Access Key ID" to --cloud-access-key-id option and "Secret Access Key" to --cloud-secret-access-key option.

After you created a user you need to grant necessary permissions to it. There are many ways to manage AWS user permissions, but for our test we can choose simplest way: click on "Attach User Policy" button under "User Policies" part, then select "Amazon S3 Full Access". We are ready to try backup now.

To summarize, following Cloud options are required:--cloud-service=s3 - it is always s3 and must be specified--cloud-aws-region='us-west-2' - here is the tricky part: you could specify different region when created the bucket, but default region should be used, so AWS is able to find the bucket--cloud-bucket=ourbucket - name of the bucket--cloud-access-key-id=AKIAJ2DK2OBDEGQSBGSQ - access key ID--cloud-secret-access-key=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 - Secret Access Key--cloud-object-key=test - any name: this will be name of the image in the bucket

Add common MEB options, such as:--backup-dir=/path/to/backup/dir/to/store/temporary/files--backup-image=- - so we are storing in stdoutbackup-to-image - this is not an option, but the command =)