How to Set Up AWS Relational Database Services with MySQL

How to Set Up AWS Relational Database Services with MySQL

Hello everyone! Let's learn about Amazon Relational Database Services (RDS). An amazing product that lets you set up, scale and operate a relational database in the cloud. In this step-by-step tutorial, we will take a look at how to set up a MySQL connection in an RDS database.

Prerequisites

  • Understanding of relational databases. To learn more, read this article
  • An AWS account. If you don't have one, sign up here
  • MySQL Workbench installed in your machine. If not, install here

Step 1: Create Database in AWS RDS

Sign in and go to console.aws.amazon.com/rds. On the left-hand panel, make sure you are on Dashboard, then click Create Database. image.png

Choose Standard Create option and the database you want to integrate with. I'll choose MySQL for this tutorial.

image.png

Choose the MySQL version you want to use, then select Free Tier. The other options would incur costs. image.png

Next, name your DB instance. It can be anything you want, then proceed to create a username and password for it.

image.png

Leave the rest of the settings below as it is.

image.png

Scroll down to the Connectivity section. Set Public access to Yes and select Choose Existing for our Virtual Private Cloud (VPC). This will set it to the default.

image.png

Under Database Authentication, select Password Authentication, and you're done. Click Create Database at the bottom of the page to continue.

image.png

Step 2: Edit Inbound Rules

Our database is now all set up! Let's make sure we can access it from our local MySQL Workbench by editing the inbound rules. To do that, head to your RDS Console and navigate to Databases on the left panel.

Then, under Security Group Rules click on the Security Group that has the Type column as Inbound.

image.png

After clicking it, a new tab will open to the Security Groups page. Click on the Security Group ID.

image.png

And now, you can edit the Source to Custom or MyIP, whichever one you want to specify. For my example, I'm setting it to Custom, at IP 0.0.0.0/0. This means that this RDS Database can be accessed from any IP. Click Save Rules and close the tab. image.png

Step 3: Set Up Workbench

All we need to do now is to create a new connection on MySQL Workbench.

If you haven't already, install MySQL Workbench.

Then, set up a new connection by clicking on the ⊕ icon as shown in the screenshot below.

image.png

Fill in your username and password according to the RDS Database you've just created. image.png

Enter the hostname and port number according to the values from your RDS Console under Databases > Connectivity & Security. image.png

Once that's done, you can click on the Test Connection button to see if it can connect to the RDS Database successfully. Click OK once successful.

image.png

Next Steps

We have just performed the necessary steps we need to deploy a MySQL database instance on the cloud with AWS RDS. Now we can integrate it with an app and operate it just like any other database.

To learn how to build a Node.js CRUD app with MySQL integration, feel free to read my beginner-friendly series.

Thanks for reading! I hope it has been a helpful introduction to AWS RDS. If you find this article helpful, be sure to like and share it around for more reach. To learn more about RDS and its amazing features, please check out the References section below. Cheers!


References

Did you find this article valuable?

Support Victoria Lo by becoming a sponsor. Any amount is appreciated!