Hello everyone welcome to master2teach step by step guide
in this video you will learn how to create RDS instance in AWS relational
database service how to connect the RDS database from the ec2 server which we
have created in the previous video or the security and better performance we
are keeping the application layer and the database layer separately I will try
my best to explain step by step if you haven't subscribed to our channel please
click on the subscribe button and subscribe to our YouTube channel
Amazon RDS is a web service that makes it easier to set up operate and scale a
relational database in the a aws cloud it provides cost efficient, resizable
capacity for an industry standard relational database and manage common database
administration task open the AWS console page
search for the RDS and click and open it you can see the promotion of Amazon
Aurora which is MySQL and PostgreSQL compatible enterprise class database
starting at less than a dollar per day Aurora supports up to 64 TB of
auto-scaling storage capacity six way replication across three availability
zone and 15 low latency read replicas we are not going to this for this time we
will cover in upcoming tutorials for the list of database that are already
created navigate to the database menu as you can see there are 0 for now click in
create database
here you can see options for the RDS let's go through one by one first step
choose the database creation methods standard create and easy crate in
standard we have to set all of the configuration options including one of
ability security backup and maintenance whereas in easy crate AWS recommended
best practice configuration for now let's go with the standard so that we
can explore all options one by one the next option is engine options you can
see there are six different type of relational database services that you
can use in AWS amazon aurora, mysql MariaDB postgre SQL Oracle and MySQL
SQL Server AWS has non-relational database option as well which is
DynomoDB which we will learn about it in upcoming tutorials for now we are going
to set up mysql MySQL is the most popular open source database in the
world MySQL offered the rich feature of MySQL
community skills with the flexibility to easily scale compute resources or
storage capacity for your database it supports database size up to 64 TB
supports general-purpose memory optimized and brush table performance
instance classes supports automated backup and point in time recovery
supports up to five Reed replicas per instance within a single region or cross
region let's move further now select the editions or version of my skill that you
need as per your programming language for now let's choose five point seven
point two and two next is the template options production
is used for high availability and fast consistent performance Dev or Test is
used for development used outside of a production environment which will be
cheaper than production so let's choose Dev or Test template for now setting
specify a DB instance identifier name that is unique for all DB instances
which will helps to identify the database note that it's not the database
name
master2teach rds db the next step is set up the master user
after database admin as master username and password as a password for now it's
not a good and secure password but for now let's use it
another option is DB instance size there is more option to choose as per
your requirement as we choose one core CPU with 1gb RAM while we set up the
Ubuntu server in EC2 for now let's go with the minimum option which is
2 CPUs with 8GB RAM EBS 450 Mbps general purpose SSD size for now 8 GB is
sufficient another wow feature is auto-scaling
either you can enable auto scaling your DB or not you can set up minimum up to
21 GB and maximum up to 65,536 GB
next option is availability and durability if you need a backup in case of server down
then create a standby instance that will create a standby in a different
availability zone to provide data redundancy eliminates IO freezes and minimize
latency spikes during system backup next is VPC for now we are going to set
up in default VPC which we choose the same in EC2 we are setting up EC2
and RDS instances in the same network so that we have another option publicly
accessible if we choose no here RDS will not assign a public IP address
to the database only Amazon EC2 instances and devices inside the VPC can
connect to your database that means we cannot even connect this database from
your local terminal to connect to this database we have to go through the EC2
instance which is in the same network mean VPC choose the VPC security groups
for now let's choose the existing VPC security group which we had created
while configuring easy - in the previous video which is easy to Linux tutorial
choose availability zone currently we are working in north Virginia where are six
availability zones for now let's go with no preference
another is database port 3306 is the default DB port let's move with the
default port another option is database
authentication where we can set up another extra layer of security beside
database username and password that is the IAM role
there is another additional compression as well let's remove automatic backup for
now another options let's leave it attics for now estimated monthly cost DB
instance one hundred and twenty seven point seven five US dollar storage
zero point nine two two US dollar total monthly bill is about one hundred twenty
eight point six seven years dollar after finished all settings click in create database
it will take some time to create the database as per our configuration during
this let's see one another part which is inbound rules in EC2
in EC2 clicking security groups and clicks the security groups that we have
created while configuring EC2 - as you can see we have open access to only HTTP
with port number 80 and SSH with port number 22 the RDS that we are
creating can assess through port number 3306 so that we have to open for it as
well so edit inbound rules add rules you can see there are lots of options choose
mysql / aurora using TCP requests in port number 3306 from you can set to
anywhere or can specify to allow the request from the particular EC2
instances application as well
for now let's pick it anywhere and save rules
let's check our RDS instance now it's running an active
up to now we have done two jobs one we set up the Ubuntu server in the previous
video using EC2 instance for PHP and second we set up the RDS instance for
the MySQL database now let's move to assess the MySQL database from EC2
instance open the terminal and connect to the
server as we learned before in the previous video
now if we try MySQL it says the program
MySQL can be found in the following package so let's install the MySQL
client package first sudo apt-get install MySQL client core
5.7
want to continue yes
now we can use the MySQL command let's connect to MySQL DB as you know to
connect a database we need three things host username and password we have a
master username and password what about the host for host info open
the database list
select and click for detail of the database here end point represents the
host
now let's connect to the database the command to connect the database is MySQL
dash h which is for the hostname copy and paste the endpoint
- capital P which is for the port 3306 - u for the username admin and there's
small p for the password to not place the password here enter without
password it will ask the password we place the password as password
now we can access the database now you can create the database tables in
the RDS instance in this way you can create an RDS instance for the separate
database environment and set up as per your needs in AWS in the next
video tutorial you will learn how to set up our simple PHP core application using
these EC2 and RDS instances I hope you learn from this video tutorial if
you have any questions or comments please make sure to leave your comments
in the comment section below also please be sure to like this video and subscribe
to my channel if you haven't already thank you very much for watching
check us out for more in IT tutorial and guide on website master2teach.com
and we will see you again soon bye