can we connect RDS based SQL Database by putty

0

Can we connect RDS based SQL Database by putty. If possible please provide me the steps or any other way we can connect.

Thanks

3 Answers
1
Accepted Answer

RDS is not available to the world by default. It's also generally a bad idea to allow access to the RDS from anywhere except from inside your VPC. I recommend you do the following:

Create a security group that allows access to the RDS over port 3306 from your EC2 instance

Visit https://console.aws.amazon.com/ec2/home#s=SecurityGroups and create a new security group. Switch to the inbound tab and choose MYSQL from the dropdown. Erase the 0.0.0.0/0 in the source field then click the input field. It will present you with a list of existing security groups. Choose the one that your EC2 instance belongs to. Click the apply rule changes button Assign the security group to your RDS

Visit https://console.aws.amazon.com/rds/home#dbinstances: and select your RDS instance and under the Instance Actions menu select Modify Change the RDS security group to the one you just created Make sure to select the Apply immediately option at the bottom of this page Click Continue and apply the new changes. (the change can sometimes take a couple of minutes) SSH into your EC2 instance then run the mysql command in your question

profile picture
answered 2 years ago
profile picture
EXPERT
reviewed 5 months ago
0

Excellent thank you. But if i don't want to manage the database let it do by AWS means I want to rely with RDS service. Please let me know how to do database related operations like creation, modification, insertion in tables.

answered 2 years ago
0

If your RDS database is public, then you should be able to connect to it using whatever database tool you use to connect to your on-prem databases, such as pgAdmin for postgres or mySQL workbench for mySQL etc.

From a security point of view, it is not recommended to keep your RDS databases public. You should create your RDS database inside a private subnet inside a VPC that you create. The security group of the RDS database should only allow inbound access on the port that your database server listens on, only from another public subnet in the VPC.

You can then create an EC2 machine in the public subnet of your VPC that will act as a bastion host. You can install the database tools on this EC2 machine.

You can use putty to ssh into the bastion host as shown here - https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/putty.html

Once you have been able to ssh into the bastion host, you can use the database tool like pgAdmin to connect to the RDS database. For more details, refer to this AWS Support article - https://aws.amazon.com/premiumsupport/knowledge-center/rds-connect-ec2-bastion-host/

profile pictureAWS
EXPERT
answered 2 years ago
  • Excellent thank you. But if i don't want to manage the database let it do by AWS means I want to rely with RDS service. Please let me know how to do database related operations like creation, modification, insertion in tables.

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions