Creating RDS database

In this chapter we will be creating the rds database and configuring it to work with our ec2 instance

creating RDS database

  1. go to the Amazon RDS console
  2. on the nav bar click database
  3. click on Create database

role 4. in the RDS database creation form :

  • in the database creation method choose Standard method

  • in the Engine Option choose MariaDB

  • Choose the latest version of the database engine in my cast being 10.6.14 role

  • in template choose free tier

    Free tier is still gona cost you money so remember to delete the database after creation

  • name the instance identifier as db-rds

  • name the master user as userdb

  • set the master password as admin123456

  • confirm the master password as admin123456 role

  • in connectivity choose Don’t connect to an EC2 compute resource

  • set the network type as IPV4

  • choose the private cloud that we created VPC-RDS-vpc

  • then choose the subnet group that we just created subnet-rds

  • set the public access to no role

  • in the VPC security choose the existing security our being SCG-RDS

  • the the certificate authority to the default

  • in the database authentication choose password role

  • create a initial database name rdsdb

  • then click create role

  1. when the creation is over which take 10 minute
  2. click on the database that we just created role
  3. then copy the end point role

configuring our easy 2 instance to work with the database

  1. paste this code which will transfer our mariadb to sql file , enter your password being admin123456
mysqldump -u root -p ec2db > ec2db.sql

role 2. then paste the end point that we copy to the <> , this code will transfer our ec2db.sql to the rdsdb , enter your password being admin123456

mysql -h <replace-rds-end-point-here> -P 3306 -u rdsuser -p rdsdb < ec2db.sql

role 3. then access the database again , enter your password being admin123456

mysql -h db-rds.cnsbm6b5qc8c.eu-north-1.rds.amazonaws.com -P 3306 -u userdb -p

role 4. enter this code to use the database then check if the value are transfer

USE rdsdb
SELECT * FROM table1;

role we can see that the value from our database have been transfer to the RDS database in Amazon