AWS - MySQL instance at RDS and connect from EC2 instance #RDS Amazon Relational Database Service (Amazon RDS) is a web service that makes it easier to set up, operate, and scale a relational database in the AWS Cloud. It provides cost-efficient, resizable capacity for an industry-standard relational database and manages common database administration tasks.. Amazon RDS supports PostgreSQL, MySQL, Maria DB, Oracle, SQL Server, and Amazon Aurora2.
-
1.
open AWS Management Console
-
2.
Click Services
-
3.
Click Database
-
4.
Click RDS (Managed Relational Database Service)
-
5.
Click "Create database"
-
6.
Select "MySQL" and click Next to continue.
-
7.
Select "Engine Version" of MySQL as 8.0.32 and click Next to continue.
-
8.
Under Templates Select " Free Tier" #3 Types of tires available in AWS RDS module 1) Production 2) Development 3) Free tire Other than free tire are chargeable. So, select Free tire. Click Next to continue.
-
9.
In "DB-Instance-identifier", give a name to your instance and click Next to continue.
-
10.
In "Master user name", set a DB admin user name and click Next to continue.
-
11.
In "Master password", set a password for the admin user and click Next to continue. Follow the password rules(constraints) mentioned below.
-
12.
In "Confirm master password" re enter the password and click Next to continue.
-
13.
Select appropriate Server configuration for Database. i.e. no of CPUs, RAM, etc. Example: “db.t2.micro”. Click Next to continue.
-
14.
In “Storage type” select “General purpose SSD (gp2)” and click Next to continue.
-
15.
Set HDD size and click Next to continue. for example "20G"
-
16.
Click Storage autoscaling
-
17.
Uncheck "Enable storage autoscaling" and click Next to continue.
-
18.
Under connectivity, choose “Don’t connect to an EC2 compute resource” and click Next to continue.
-
19.
Choose default VPC or any other specific VPC of your choice and click Next to continue.
-
20.
Select subnet group as default and click Next to continue.
-
21.
In “Public access” select NO. # Select YES for RDS Public access or NO for internal access. If you choose NO, RDS doesn't assign a public IP address to the database. Only Amazon EC2 instances and other resources inside the VPC can connect to your database. Click Next to continue.
-
22.
Under VPC Security group, choose "Choose existing Security group" for accessing the MYSQL service and click Next to continue.
-
23.
Choose your security group. Make sure your selected security group must allow MySQL port (3306) Click Next to continue.
-
24.
Choose any Availability Zone and click Next to continue.
-
25.
Expand Additional Configuration and click Next to continue.
-
26.
Set port number for the database and click Next to continue. For MySQL the default port number is 3306
-
27.
Under Database authentication, choose "password authentication" and click Next to continue.
-
28.
Expand additional configuration for providing First DB Name and click Next to continue.
-
29.
Set the DB name here and click Next to continue.
-
30.
Uncheck "Enable auto backup" and click Next to continue.
-
31.
Uncheck "Enable auto minor version upgrade" and click Next to continue.
-
32.
Click "Create database"
-
33.
Click "Close" in the popup window
-
34.
Click REFERSH to check database state and wait for availability of DB. Click Next once the database status changes to Available.
-
35.
Now DB is available, Click on your database name from the below list.
-
36.
Check that your database is "Available" (Up & running)