- Newest
- Most votes
- Most comments
Ensure the security group permits inbound traffic on port 3306 from your IP address. Inappropriately set rules are the typical reason for connection issues.
Check your RDS endpoint, database name, username, and password.
If your RDS is in a private subnet, direct access from your local machine won't function. Use a bastion host or relocate the instance to a public subnet for testing.
Hope this helps!
Based on your error message, there are several common reasons why you might be experiencing connection issues with your MySQL RDS instance:
-
Security Group Configuration: The most common cause is that the security group associated with your RDS instance doesn't authorize connections from your current IP address. You need to add an inbound rule to your security group that allows traffic on port 3306 (MySQL's default port) from your IP address. In the security group settings, you can add a rule and select "My IP" as the source to automatically use your current IP address.
-
Firewall Restrictions: Your company or network might have firewall rules blocking connections to port 3306. If this is the case, you might need to recreate the RDS instance with a different port or request an exception from your network administrator.
-
Network Connectivity: If your RDS instance is in a private subnet within a VPC, your local machine might not be able to connect directly. Ensure that your DB instance is set to be publicly accessible if you're connecting from outside the VPC.
-
Instance Status: Verify that your RDS instance is in the "Available" state and not undergoing maintenance or other operations.
-
Authentication Issues: Double-check that you're using the correct password for the masterUsername. Also, ensure there are no typos in the connection string, endpoint, or port number.
-
DNS Resolution: Make sure your client can properly resolve the RDS endpoint.
To troubleshoot, try:
- Temporarily allowing all inbound traffic in the security group (for testing purposes only)
- Connecting from an EC2 instance within the same VPC
- Using a different MySQL client to rule out client-specific issues
- Checking if the RDS instance is configured to require SSL/TLS connections
Sources
MySQL Connection Error | AWS re:Post
Troubleshooting connections to your MySQL DB instance - Amazon Relational Database Service
Cannot Connect to Database Server | AWS re:Post
Troubleshooting connections to your MariaDB DB instance - Amazon Relational Database Service
Relevant content
asked 3 years ago

It was caused from RDS endpoint, I corrected the endpoint. Thanks