In this chapter we will be creating the rds database and configuring it to work with our ec2 instance
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
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
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
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
create a initial database name rdsdb
then click create
admin123456
mysqldump -u root -p ec2db > ec2db.sql
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
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
4. enter this code to use the database then check if the value are transfer
USE rdsdb
SELECT * FROM table1;
we can see that the value from our database have been transfer to the RDS database in Amazon