Photo by Jake Nebov / Unsplash

AWS Relational Database: MySQL

AWS Jul 8, 2021

This post briefly documents the process of creating MySQL Database via the AWS RDS service.

Introduction

Amazon Relational Database Service (RDS) is a distributed relational database service by Amazon Web Services. It is a web service running "in the cloud" designed to simplify the setup, operation, and scaling of a relational database for use in applications.

MySQL is an open-source relational database management system (RDBMS). A relational database organizes data into one or more data tables in which data types may be related to each other; these relations help structure the data. SQL is a language programmers use to create, modify and extract data from the relational database, as well as control user access to the database.

Goals

  1. Database Configuration
    1.1 Database Configuration
    1.2 Templates
    1.3 Settings, Credentials Settings
    1.4 Connectivity
    1.5 Database authentication
    1.6 Additional Configuration
  2. Connectivity and security
    2.1 Connectivity and security Configuration
    2.2 Security Groups
    2.3 Edit inbound rules
    2.4 Add rules
    2.5 Inbound rules
  3. Accessing the Database via MySQL Workbench
    3.1 Setup new connection
    3.2 MySQL connection result
    3.3 MySQL Workbench

Minimum Requirements

Database Configuration

  • From the services drop down from the Navigation bar, select the RDS service from the Database section.
  • In the following page, configure the database settings.
Database Creation
  • Database creation method : Standard create
  • Engine Type : MySQL
  • Edition : MySQL Community
  • Version : MySQL 8.0.23 (or whatever is the latest avaialable version)
Templates
  • Templates : Free Tier
Settings, Credentials Settings
  • DB instance identifier : some_identifier (ex: sbmwa)
  • Master Username : some_username (ex: sbmwa_aws_user)
  • Master Password : some_password (ex: sbmwa_aws_pwd)
  • Confirm Password : some_password (ex: sbmwa_aws_pwd)
Connectivity
  • Virtual private cloud : Default VPC
  • Subnet group : default
  • Public access : Yes
  • VPC security group : Choose existing
Database authentication
  • Database Authentication : Password authentication
Additional Configuration
  • Initial database name : Schema name (ex: sbmwa_aws)
  • Finally, at the end of the page click on the Create database button.

Connectivity and security

Connectivity and security Configuration
Security Groups
Edit inbound rules
Add rules
Inbound rules

Accessing the Database via MySQL Workbench

Setup new connection
  • Open MySQL Workbench.
  • Navigate to Database > Manage Connections.
  • Click on New to setup a new connection.
  • Enter the connection details:
    • Connection Name: Enter a name for your connection.
    • Hostname: Enter the endpoint of your RDS instance.
    • Port: The default port for MySQL is 3306.
    • Username: Enter the master username.
    • Password: Enter the master password or store it in the vault.
MySQL connection result

Click on Test Connection to ensure that your settings are correct and you can connect to the database.

MySQL Workbench

Once connected, you can query the database to validate that it has been created and configured correctly.

Conclusion

Setting up a MySQL database using AWS RDS simplifies the process of database management and scaling, providing a reliable and scalable solution for your applications. This guide walked you through each step, from initial database creation to security configurations and connecting via MySQL Workbench. By leveraging AWS RDS, you can focus on your application's development and performance without worrying about the underlying infrastructure.

Following the steps outlined in this guide ensures a smooth setup process, allowing you to manage and scale your MySQL databases efficiently. AWS RDS provides numerous benefits, including automated backups, software patching, and seamless scaling, making it an ideal choice for developers and businesses alike.

Tags

Anantha Raju C

| Poetry | Music | Cinema | Books | Visual Art | Software Engineering |