Skip to main content

Command Palette

Search for a command to run...

Aurora MySQL

Setup and Cleanup Tutorial:

Updated
4 min read
P

As a associate system administrator I worked on Redhat Linux servers, including user management, permissions, services, and performance monitoring Automated routine administrative tasks using Bash scripting and cron jobs, reducing manual effort by ~30% I am aws certified sysops administrator and Google Certified Cloud Engineer. Determined to transition my career into cloud architect /Cloud Support role

This project provides a step-by-step guide to create an Amazon Aurora MySQL database, connect to it from a local MySQL client, create a test table, and then delete the database. It also covers key concepts about Amazon Aurora.

Prerequisites

  • An AWS account with appropriate permissions to create RDS resources.

  • A MySQL client installed on your computer (e.g., MySQL Workbench, Sequel Ace, or the mysql command-line client).

  • Basic familiarity with the AWS Management Console.

⚠️ Important: This tutorial uses resources that incur costs. Aurora is not included in the AWS Free Tier. An db.r5.large instance costs approximately $0.29 per hour. Remember to delete the database after completing the steps to avoid ongoing charges.

Step-by-Step Instructions

Step 1: Create a Security Group

  1. Open the AWS Management Console and navigate to VPCSecurity Groups.

  2. Click Create security group.

  3. Provide a name and description, e.g., aurora-mysql-sg.

  4. Ensure the VPC is your default VPC (selected by default).

  5. Under Inbound rules, add a rule:

    • Type: MySQL/Aurora (port 3306)

    • Source: 0.0.0.0/0 (allows traffic from the public internet – only for this demo)

  6. Click Create security group.

https://images/step1-create-sg.png


Step 2: Launch an Aurora MySQL Database

  1. Go to RDS in the AWS Console.

  2. Click Create database.

  3. Choose Standard Create.

  4. Under Engine options:

    • Engine type: Amazon Aurora

    • Edition: Amazon Aurora MySQL-Compatible Edition

    • Version: (select the latest available)

  5. Templates: select Dev/Test.

  6. Settings:

    • DB cluster identifier: aurora-demo-cluster

    • Master username: admin (or your choice)

    • Master password: Enter your own password (and confirm).

  7. Instance configuration:

    • DB instance class: Burstable classes (includes t classes) → db.r5.large (or select from Memory Optimized classes).
  8. Storage: Leave default auto-scaling settings.

  9. Connectivity:

    • Virtual Private Cloud (VPC): Choose your default VPC.

    • Public access: Yes (enable public accessibility).

    • VPC security group: Select Choose existing and pick the security group you created (aurora-mysql-sg).

    • Availability Zone: No preference.

  10. Additional configuration (optional):

    • Initial database name: testdb (or any name you like).

    • Leave other settings as default.

  11. Click Create database.

The database will take several minutes to become available. Wait until the status shows Available.

https://images/step2-create-db.png


Step 3: Obtain the Endpoint

  1. In the RDS console, click on your new cluster (the cluster name, not the instance).

  2. In the Connectivity & security tab, locate the Writer endpoint. It looks like aurora-demo-cluster.cluster-xxxxx.region.rds.amazonaws.com.

  3. Copy this endpoint – you will use it to connect.

https://images/step3-endpoint.png


Step 4: Connect from Your MySQL Client

Use your preferred MySQL client to connect to the database.

Example using MySQL Workbench:

  1. Open MySQL Workbench and click the + icon to create a new connection.

  2. Enter:

    • Connection Name: Aurora Demo

    • Hostname: Paste the writer endpoint.

    • Port: 3306

    • Username: admin (or the master username you set)

    • Password: Click Store in Keychain and enter the password.

  3. Click Test Connection to verify.

  4. If successful, click OK to save and then open the connection.

https://images/step4-workbench-connect.png


Step 5: Create a Test Table

Once connected, run the following SQL commands to create a simple table and insert a record:

sql

CREATE TABLE test (
    id INT PRIMARY KEY,
    name VARCHAR(50)
);

INSERT INTO test (id, name) VALUES (1, 'Hello from Aurora');

SELECT * FROM test;

You should see the inserted row.

https://images/step5-test-table.png


Step 6: Delete the Database

To avoid ongoing charges, delete the database cluster:

  1. In the RDS console, select your cluster (aurora-demo-cluster).

  2. From the Actions menu, choose Delete.

  3. Uncheck Create final snapshot? (or keep if you need a backup).

  4. Confirm by typing delete me and click Delete.

https://images/step6-delete.png

The deletion process will take a few minutes.