AWS: can't connect to RDS database from my machine

后端 未结 7 1516
野的像风
野的像风 2021-01-30 10:10

The EC2 instance/live web can connect just fine to the RDS database. But when I want to debug the code in my local machine, I can\'t connect to the database and got this error:<

相关标签:
7条回答
  • 2021-01-30 11:07

    Well almost everyone has pointed out the answers, i will put it in different perspective so that you can understand.

    There are two ways to connect to you AWS RDS

    1. You provision an instance in the same VPC & Subnet. You install the workbench you will be able to connect to the DB. You would not need to make it public accessible. Example: You can provision an windows instance in the same VPC group and install workbench and you can connect to the DB via endpoint.

    2. The other way is to make the Db publically accessible to your IP only to prevent unwanted access. You can change the DB security group to allow the DB port traffic to your IP only. In this way your DB will be publically accessible but to you only. This is the way we do for various AWS services we add there security group in the source part of the SG.

    If both the options doesn't work then the error is in the VPC routing table, you can check there if it associated with the subnet and also if the internet gateway is attached.

    You can watch this video it will clear your doubts:

    https://youtu.be/e18NqiWeCHw

    0 讨论(0)
提交回复
热议问题