Use Amazon RDS (Managed MySQL Database)

mysql

Free service

AWS RDS (Relational Database Service) lets you run MySQL with automatic backups, security, and updates — no server setup needed.

Pre-requisite: UC2 Server


✅ Steps to Create a MySQL Database on Amazon RDS

1. Go to RDS

  • In AWS Console, search for RDS and click it

2. Click “Create database”

3. Choose:

  • Database creation method: Standard Create
  • Engine options: Select MySQL
  • Version: Choose latest (8.x is good)

4. Settings

  • DB instance identifier: e.g., mydb
  • Master username: admin (or your choice)
  • Master password: Create a strong password

5. Instance size

  • Select Free tier: db.t3.micro

6. Storage

  • Keep default (20 GiB is fine for now)

7. Connectivity

  • VPC: Default
  • Public access: Yes (so you can connect from outside)
  • VPC security group: Create new or select one that allows port 3306 (MySQL)

8. Additional configuration

  • Database name: e.g., mydatabase
  • Keep defaults for rest (you can adjust later)

9. Click “Create database”

Wait a few minutes for the DB to launch.


✅ 10. Connect to Your MySQL DB

Once it’s ready:

  1. Go to Databases > your-db-name
  2. Copy the Endpoint and Port
  3. Connect using a MySQL client:

From EC2 terminal:

sudo apt update
sudo apt install mysql-client -y

mysql -h your-endpoint.rds.amazonaws.com -P 3306 -u admin -p

Enter your password when prompted.