> For the complete documentation index, see [llms.txt](https://gyansetu-aws.gitbook.io/aws-cloud/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://gyansetu-aws.gitbook.io/aws-cloud/practical-18.md).

# Practical

#### &#x20;1. Launching an instance

&#x20;We can launch the DB using EC2 OR RDS

&#x20;**1. EC2**&#x20;

* Go to ec2 -> launch instance -> rhel -> launch -> login&#x20;
* \#yum install -y mariadb\*
* &#x20;\#yum update -y&#x20;
* \#systemctl restart mariadb
* &#x20;\#systemctl enable mariadb

#### &#x20;2. RDS

```
Create a security group -> SG name
(RDSSecurity) ->Description (RDSSecurity) -> VPC
(default) ->add rule -> mysql/aurora (3306) ->add
source (copy the SG id of ec2 instance and paste it
to source, because we are going to allow only the
connection from ec2) -> Go to RDS -> select
MariaDB -> dev/test -> DB instance class (t2.micro)
-> multi-AZ deployment (no) -> storage type (ssd) ->
allocated storage (5G, max 6TB) -> DB instance
identifier (nirmal, give a unique name to identify DB)
-> master username (nirmal) -> master password
(pragathi, give any 8 character) -> confirm password
-> VPC (default) -> subnet (default) -> publicly
accessible (no, if set to yes the RDS will have a
public ip so anyone can access from outside -> VPC
SG (RDSSecurity, one that you created) -> DB Name
(MariaDB) -> backup retention period (7 days, max
35days, maximum no.of days the snapshot should
be retained) -> Backup window (default, specifying
at wot time the backup should be done) -> Auto
minor version upgrade (yes) -> Launch DB instance.
```

#### &#x20;3.Login to EC2 and connect to RDS

```
Check mariadb is working fine or not->
#mysql -u root -p
If working
#mysql -h (endpoint, without port no) -P 3306 -u
(username) -p
(check whether connection is happening to
RDS or not, then show some basic MariaDB cmd)
```

#### &#x20;4.Restoring DB

&#x20;if we restore its going to recreate a new instance with a new endpoint.

```
Select action -> go to pointin time -> use
latest restorable time (latest) or custom restore
time -> launch
```
