Troubleshooting
Can't Connect to a Database
Fix connection errors between your app and a managed database.
If your application cannot reach its managed PostgreSQL database, work through these.
Checklist
- Use the connection string from the console. On the database Overview, the Connection panel builds a ready to use string for a role and database. Copy it in the format your app needs.
- Require SSL. All connections use SSL. Make sure your client requests it, for example
sslmode=require. The provided strings already include this. - Store it as an environment variable. Put the connection string in your app's environment variables, and remember that changes apply on the next deployment.
- Check the role and database. The role you connect with must exist and own, or have access to, the database you target. Manage these on the Access tab. Deleting a role removes access for anything using its credentials.