| by Arround The Web | No comments

How to Connect to AWS RDS

Amazon Relational Database (AWS RDS) simplifies database management by automating time-consuming and complex tasks. With less work on management, you can focus on the optimization tasks of the database. AWS RDS allows you to use a relational database of your choice. Including MySQL, MariaDB, Oracle, etc.

Let’s start with the connection of AWS RDS:

Connect to AWS RDS

To connect to the AWS RDS, you should have an AWS EC2 instance created. An EC2 instance list will be displayed in the “Instances” section on the left panel of the EC2 dashboard:

After that, simply click on the “Services” button. Then click on the “Database” section to open an “RDS” dashboard:

After that, you will be directed to the Amazon RDS dashboard. On the left panel, simply click on the “Databases” button and it will show you the list of all the created databases then simply click on the name of the database:

From there, you need to edit the security groups by adding the following ports for “MYSQL” access:

From the summary page of the RDS instance, you need the “Endpoint” for the connection command:

Now start with connecting the EC2 instance that you already have created by copying the command from the “Connect page” on the EC2 dashboard:

After connecting to the EC2 virtual machine you need to type the following command:

mysql -h <End Point> -P 3306 -u <username> -p

The command we used is written below:

mysql -h demo.c6d50j4forkq.ap-southeast-1.rds.amazonaws.com -p 3306 -u admin -p

Then it will ask for the password for your database simply enter the password and press enter:

You are now connected to the AWS RDS and to check the databases in the RDS you need to enter the following command:

SHOW Databases;

This command will list all the databases created in the AWS RDS:

You have successfully connected to AWS RDS.

Conclusion

To connect to AWS RDS, you need to create an EC2 instance because your RDS database will be connected through the EC2 virtual machine. Then copy the endpoint of the database from the RDS dashboard and paste it into the connection command on the command prompt or PowerShell after this command is executed you will be asked to enter the password, and after that, RDS will be connected. In this post, you have learned how to connect to AWS RDS.

Share Button

Source: linuxhint.com

Leave a Reply