Troubleshooting connections to your RDS for PostgreSQL instance (original) (raw)

Topics

Error – FATAL: database name does not exist

If when trying to connect you receive an error like FATAL: database`name` does not exist, try using the default database name postgres for the--dbname option.

Error – Could not connect to server: Connection timed out

If you can't connect to the DB instance, the most common error is Could not connect to server: Connection timed out. If you receive this error, check the following:

GRANT CONNECT ON DATABASE database name TO username;  

Errors with security group access rules

By far the most common connection problem is with the security group's access rules assigned to the DB instance. If you used the default security group when you created the DB instance, the security group likely didn't have access rules that allow you to access the instance.

For the connection to work, the security group you assigned to the DB instance at its creation must allow access to the DB instance. For example, if the DB instance was created in a VPC, it must have a VPC security group that authorizes connections. Check if the DB instance was created using a security group that doesn't authorize connections from the device or Amazon EC2 instance where the application is running.

You can add or edit an inbound rule in the security group. ForSource, choosing My IP allows access to the DB instance from the IP address detected in your browser. For more information, see Provide access to your DB instance in your VPC by creating a security group.

Alternatively, if the DB instance was created outside of a VPC, it must have a database security group that authorizes those connections.

For more information about Amazon RDS security groups, see Controlling access with security groups.