Set Up Your First Database on RDS and Connect MySQL to Create Database through Terminal.
Amazon Relational Database Service (RDS) is a web service that helps you set up, manage, and scale a relational database in the AWS cloud. It automates many database management tasks, such as backups, patching, and provisioning, so you can focus on your applications and business.
Here are some benefits of using Amazon RDS
Cost-efficient : You only pay for the resources you use.
Easy to use : You can use the same tools and applications you already use with your existing databases.
Scalable : You can scale the compute resources or storage capacity of your database instance.
Replication : You can use replication to improve data durability and availability.
Database engines : You can use a variety of database engines, including open source and commercial options.
To create your first RDS instance with MariaDB on AWS and connect to it using the MySQL command line interface (CLI) to create a new database, you need to first set up the RDS instance in the AWS console, then use the MySQL client to connect and execute SQL commands to create the database.
Prerequisites are : Having an account of AWS Console.
Step 1 : On the search option just search for RDS & hit Enter. On the navigation click on database to create one.
Select 2 : Tick Standard create then tick on MariaDB.
Step 3 : On templates tick Free tier. On the settings fill the creadentials as asked. On Instance configuration tick Burstable class.
Step 4 : Check all configuration before create the database.
Step 5 : Here we can see our database is in creating stage.
Step 6 : Here we go our database is in available state.
Step 7 : Here we on search bar search for EC2 and hit that and create one with simple configuration.
Step 8 : After the instance on running state just ssh into it. Update the instance, Install the mysql-client in it, check the —version of mysql.
Steo 9 : Then try to connect the database through terminal.
Step 10 : Go to the vpc security group and modify or allow the rule of mysql from anywhere.
Step 11 : Again try to ssh into it.
Step 12 : After successfully connected into the instance. copy the endpoint of Database and run it with mysql host and login into it with username and password.
Step 13 : Here we can see after log in into mysql , how many databases are here.
Step 14 : Here we will create new datsbase through CLI
Step 15 : Here we go our database are created successfully.
Overall, We’ve successfully set up an Amazon RDS instance for MySQL and connected to it, allowing for a managed database environment. Using the MySQL command-line interface, you created a new database, demonstrating your ability to interact with the database effectively. This foundational knowledge prepares you for efficient data management and future database tasks.