← Back to all fixes
Application cannot connect to RDS
The Issue
App throws: `could not connect to server: Connection timed out — Is the server running on host "mydb.xxx.rds.amazonaws.com"`
Root Cause
RDS security group does not allow inbound traffic from the app server, or RDS is in a private subnet the app cannot reach.
How to Fix
Check RDS security group — it must allow inbound on port 5432 (Postgres) or 3306 (MySQL) from the app's security group or IPEnsure both app and RDS are in the same VPC, or VPC peering is configuredRDS should be in private subnets — app accesses it via VPC, not public internetTest connectivity from app server: `nc -zv mydb.xxx.rds.amazonaws.com 5432`Check RDS instance is in "Available" state in the console