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개 답변
0
수락된 답변

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
답변함 2년 전
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.

답변함 2년 전
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
전문가
답변함 2년 전
  • 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.

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인