aws rds ai_generated true

OperationalError: (2003, 'Can't connect to MySQL server on rds-host (timed out)')

ID: aws/rds-connection-timeout

Also available as: JSON · Markdown
91%Fix Rate
93%Confidence
50Evidence
2023-01-01First Seen

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
any active

Root Cause

Cannot connect to RDS instance — usually a security group or network configuration issue.

generic

Workarounds

  1. 95% success Check security group inbound rules: allow port 3306 (MySQL) or 5432 (PostgreSQL) from your IP/VPC
    Security group must allow the database port from the client's IP or security group

    Sources: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_Troubleshooting.html#CHAP_Troubleshooting.Connecting

  2. 88% success Verify the instance is in a reachable subnet — check VPC routing tables and NAT gateway
    Private subnets need NAT gateway for outbound; clients need a route to the RDS subnet

Dead Ends

Common approaches that don't work:

  1. Making the RDS instance publicly accessible 85% fail

    Security risk; database exposed to the internet

  2. Opening all ports in the security group (0.0.0.0/0) 95% fail

    Exposes all services; major security vulnerability

Error Chain

Frequently confused with: