How to Create a MySQL Database on AWS (Amazon Web Services)

How to Create a MySQL Database on AWS (Amazon Web Services)

This article is part of our series designed to help you get started with analyzing data in the cloud. We recommend that you read our previous article on how to create an AWS account.

Setting Up a MySQL Database on AWS

To create your MySQL database on AWS, log in to your account and follow these steps:

1) Select Your Region. In the top-right menu, you have the option to choose the region where your database will be created. AWS regions determine the data center location and affect the hourly pricing. For example, setting up a database in São Paulo is significantly more expensive than in Virginia, though it offers lower latency. Since this article focuses on analytical databases (Data Warehouses and Data Lakes), a few microseconds of latency are acceptable, so we’ll be using the US East 1 (N. Virginia) region.

2) Search for “RDS” in the top search bar and select the RDS service.

3) On the main RDS page, click “Create database.”

4) On the database creation page, select “Standard Create” as the method.

5) In the next section, choose the type of database. Select “MySQL.”

6) In the following section, you can pick a setup template. AWS offers a free-tier option for new members, which helps reduce costs during the first few months.

7) Next, fill in some basic database details, such as the server identifier, master username, and password. This is straightforward, but make sure to save the master user password since it cannot be recovered later.

8) The instance configuration section will be pre-filled based on the free-tier template selected in step 6.

9) The storage settings will also be automatically configured for the free-tier, so there’s no need to change anything.

10) In the connectivity section, choose the VPC where your database will be created or create a new one. If your account is new, you can leave the default VPC selected. Here, adjust some settings to allow access from machines outside your network, like your data analysis and visualization tools (don’t worry, we’ll set up a firewall later). Set “Public Access” to “Yes.”

11) In the VPC security group section, select “Create new” and give your security group a name.

12) Once that’s configured, find the “Additional Configuration” section at the bottom of the page.

13) Give your database an initial name, like “kondado.”

14) Scroll down and click “Create database.”

15) After a few moments, you’ll be redirected to the page listing your databases, and you’ll see your new database being created. While this is happening, let’s set up the security rules by clicking on your database.

16) On your database page, find the “Security and Connection” section and click on your security group name.

17) In the security group screen, we’ll add rules specifying who can access your database: Find the “Inbound Rules” tab and click “Edit Inbound Rules.”

18) By default, your database is only accessible from one IP. If you want to keep this setting, you can skip to step 24.

19) To remove the original access rule, click “Delete” on the right side of the rule.

20) Click “Add Rule” to add new rules. You’ll need to add a separate rule for each IP address you want to grant access to.

21) When adding a new rule, make sure to select the correct port (3306 for MySQL) in the “Type” column.

22) Important rules to add include your own IP address (to allow access with tools like Power BI) and Kondado’s server IPs, which can be found by   clicking here

23) Once you’ve added all the IP addresses, click “Save Rules.”

24) Go back to the RDS console homepage, select “Databases” from the left menu, and click on your newly created database.

25) Your database is now set up! In the “Security and Connection” section, you’ll find your database’s host address. The username, password, and database name were configured in steps 7 and 13.

Adding Your New MySQL Database as a Destination in Kondado

 To learn how to add your newly created MySQL database as a destination in Kondado,  click here.