So, I just created the Amazon RDS account. And I started an instance of database.
The "endpoint" is:
abcw3n-prod.cbmbuiv8aakk.us-east-1.rds.amazonaws.com
Great! Now I try to connect to it from one of my other EC2 instances.
mysql -uUSER -pPASS -habcw3n-prod.cbmbuiv8aakk.us-east-1.rds.amazonaws.com
But nothing works and it just hangs.
I tried to ping it, and nothing works either. Nothing happens.
Do I need to change some settings?
By default RDS does not allow any connection that is not specified within the Security Group (SG). You can allow based on CIDR addressing or by Amazon account number which would allow any EC2 under that account to access it.
It is "just hanging" as you have not configured the firewall to accept mySQL connections from your other instance, as such the packet is being dropped at the firewall level, to resolve this you need to:
NOTE the source IP for the server will not be your elastic IP (in most cases anyway) you will have an internal ip on the device (ifconfig on linux will show you this).
A lot of talk here about security groups, but also check:
(The routing group was my problem; in creating a new subnet, I neglected to add it to a routing group with a gateway.)
Fixed.
Had to grant access to it in the security groups under the DB...
I had the same issue ;
worked for me ...
In an attempt to open up security completely for testing before locking down access, both my database instance and my EC2 instance used the same security group, and both inbound and outbound port 3306 were configured to allow connections from Anywhere. The problem -- I was able to connect to Aurora from my notebook but oddly enough not from my EC2 instance, as if the EC2 instance wasn't Anywhere. The solution was to add another inbound mysql/Aurora rule and specify that same security group id as the source for inbound connections. My security group has a rule that refers to itself, and I can connect from either my notebook or my EC2 instance.
Make sure that your VPC and subnets are wide enought.
The following CIDR configuration works great for two subnets:
VPC
10.0.0.0/16
10.0.0.0 — 10.0.255.255 (65536 addresses)
Subnet 1
10.0.0.0/17
10.0.0.0 — 10.0.127.255 (32768 addresses, half)
Subnet 2
10.0.128.0/17
10.0.128.0 — 10.0.255.255 (32768 addresses, other half)
Adjust it if you need three subnets.
I wasn't being able to connect to my RDS database. I've manually reviewed any detail and everything was alright. There were no indications of any issues whatsoever and I couldn't find any suitable information in the documentation. My VPC was configured with narrow CIDR: 10.0.0.0/22 and each subnet had a 255 addresses. After I've changed CIDR to 10.0.0.0/16 and split it totally between two subnets my RDS connection started to working. It was a pure luck that I've managed to find a source of the problem, because it doesn't make any sense to me.
mysql inbound rule should be like below
this is the problem with security group.