Links

MySQL

Learn how to upload MySQL database backups to Filebase.

What is MySQL?

MySQL is a popular and widely used open-source relational database management system.
Read below to learn how to upload a MySQL database backup to Filebase.

Prerequisites:

  • Have data stored in a MySQL database.
  • Sign up for a free Filebase account.
  • Have your Filebase Access and Secret Keys. Learn how to view your access keys here.
  • Create a Filebase Bucket. Learn how to create a bucket here.

1. You can use the following command to create a dump of your MySQL data from all databases.

mysqldump -u [user] \
-p [password] \
-h [host] \
--single-transaction \
--routines --triggers \
--all-databases

2. Then, save the output of this command to a file:

mysqldump -u [user] \
-p [password] \
-h [host] \
--single-transaction \
--routines --triggers \
--all-databases | gzip > mysql_backup.sql.gz

3. Then you will need to upload the mysql_backup.sql.gz file to Filebase.

You can use a variety of tools for this, but this guide will use AWS CLI.

5. Configure AWS CLI to work with Filebase and your Filebase account. To do this, run the command:

aws configure
This command will generate a series of prompts, asking for the Access Key ID and Secret Access Key. It will also ask for a region and an output format, though you can leave both of these fields blank by pressing enter when prompted for them.
For more information on AWS CLI, see our full guide here.

6. After completing the prompt, you can upload your mysql_backup.sql.gz file file to Filebase with the command:

aws --endpoint https://s3.filebase.com s3 cp mysql_backup.sql.gz s3://filebase-bucket
If you have any questions, please join our Discord server, or send us an email at [email protected]