Skip to Content

How to configure an Amazon RDS environment for MySQL

Posted on October 29, 2022 by

Categories: AWS

Tags:

I’ll describe how to set up the RDS MySQL Environment on AWS in this article. We can launch any relational database instance using RDS, the Relational Database Service provided by Amazon, without having to bother about the supporting infrastructure. Users may start creating database applications and establishing connections to this instance relatively quickly. This post will concentrate less on the specifics of MySQL and more on how to configure the RDS MySQL Environment.

Although there are other RDS service levels that may be used to deploy the RDS MySQL Environment, for the sake of this article, we will just focus on the free tier. If necessary, you can create an instance as needed. The service fee for the databases may vary depending on the processors and time. Users of the free-tier are permitted to utilise the RDS service at no cost for a maximum of 750 hours per month, which I believe is sufficient to keep the service operational without the need for further fees.

establishing the RDS environment

Let’s first create an AWS Account before establishing the RDS MySQL Environment. Once the AWS account has been properly created, type RDS into the Find Services bar and press Enter.

MySQL RDS Environment

Create the RDS MySQL Environment by selecting Open RDS from the drop-down option. Click Create Database on the following screen to access the database. By clicking on this, you’ll be sent to another page where you may enter the information needed to set up the MySQL database.

Establishing a MySQL database

A new page appears after clicking the Create Database button, allowing you to specify the database creation technique and other settings. Applying the adjustments shown in the image below will be done now. As a technique for creating the database, we will choose Standard Create. This will enable us to independently setup all relevant parameters. Choose MySQL as the Engine Type and the most recent version next. The most recent version of MySQL was 8.0.16 at the time this article was being written.

The Database Engine You Should Use

The name and connection information for the MySQL database that we will build will be provided in the following step. Select the Free Tier from the template and continue as we will be creating the database in the free tier. Give the database instance an appropriate name, such “mysql-db-test01” in the example below. Provide an appropriate master login and password in a similar manner. You will use this username and password to login to this MySQL instance in the future. Additionally, you must safeguard these credentials to enable future use.

The Instance Credentials are setup

After setting the instance credentials, let’s go on to setting some more parameters that are necessary to configure the RDS MySQL Environment. Choose “db.t2.micro” for the database instance size and “general purpose SSD” for the storage type. The memory amount is set by default to 20GB, which is adequate at the present.

Setting the Database Instance Size

The RDS Database instance’s connectivity settings should be defined in the next step. Choose the pre-configured default VPC connection from your login. I’ve already established some RDS instances for my use case, therefore I’ll utilise the same VPC for this instance as well. Within the VPC connection, we should additionally add a Subnet Group. We should set Publicly Accessible to Yes as we will be utilising the database instance outside of the AWS Environment. Finally, choose “Choose Existing” for the VPC Security Group and continue.

Setting Up Connectivity for the RDS MySQL Environment

The last step in building the database is to choose the Database Authentication Mode as Password Authentication now that the majority of the setting has been completed. Click Create Database after everything is finished.

AWS RDS database creation

It may take some time for AWS to construct the RDS instance and make it accessible once you click Create Database in the previous step. You’ll get a signal that the database has been successfully built in a short while.

Successful creation of the RDS MySQL Environment

The newly added MySQL Community instance is also added to the Databases list, as you can see in the image above. I have already built an RDS instance for SQL Server. Select the DB Identifier for the MySQL Database by clicking it. An additional page with details about the MySQL database instance will open. The Endpoint that is provided in this case is crucial to keep in mind. Later, the MySQL Workbench tool will connect to the instance using this endpoint information.

Database instance for MySQL

Allowing connections from the public network to the instance is the next stage in this process. Click on the VPC Security Groups and then open the new page to activate this.

Security Groups for VPC

Click the Edit Inbound Rules button on the Security Group page. We’ll be able to change the IP addresses that have access to the MySQL Database instance thanks to this.

To edit inbound rules, choose

The page for inbound editing rules appears. We will add a custom rule to this page that will let any IP address connect to the RDS Instance on port 3306 in the future. The default port on which MySQL is often set is 3306. Allowing traffic to a certain port should be done if you are utilising another one.

Select Anywhere as the Source when you click the Add Rule button. This will enable connections to the MySQL instance on the RDS from any traffic outside the AWS environment. Once finished, click Save Rules.