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:<
I was also not able to connect even from inside an ec2 instance.
After digging AWS RDS options it turns out that ec2 instances are only able to connect to RDS in the same VPC they are in.
When creating an ec2 instance in the same VPC where the RDS was I could access it as expected.