---
title: How to Fix the "Connection Refused" Error When Connecting to a Vultr Managed Database?
url: https://docs.vultr.com/support/products/storage/databases/how-to-fix-the-connection-refused-error-when-connecting-to-a-vultr-managed-database
description: "Find out why a Vultr Managed Database refuses connections: wrong port, restrictive Trusted Sources, or VPC limits."
publish_date: 2025-09-15T13:58:36.269908Z
last_updated: 2026-10-26T23:32:46.439478Z
---

> Index of every Vultr Docs page in markdown: https://docs.vultr.com/llms.txt

# How to Fix the "Connection Refused" Error When Connecting to a Vultr Managed Database?

reference slug: products/storage/databases/postgresql
reference slug: products/storage/databases/valkey

# How to Fix the "Connection Refused" Error When Connecting to a Vultr Managed Database?

A `Connection Refused` error typically indicates that the client’s attempt to establish a TCP connection to the database server was blocked or rejected. This issue usually arises due to network-level restrictions, misconfigured connection parameters, or access control policies enforced by the managed service.

## Connection Refused (Using Hostname)

Vultr Managed Database clusters provide a `hostname` that should be used in your connection string. This `hostname` is managed by Vultr’s DNS to always resolve to the current IP address and port of your cluster. Connecting via `hostname` is recommended because it:

* Abstracts any underlying IP changes.
* Avoids complications related to private network configurations.
* Ensures the client targets the correct endpoint consistently.

For details on retrieving connection parameters, see the dedicated Connection Details guides for [MySQL](https://docs.vultr.com/products/storage/databases/mysql/management/connection/connection-details), [PostgreSQL](https://docs.vultr.com/products/storage/databases/postgresql/management/connection/connection-details), [Valkey](https://docs.vultr.com/products/storage/databases/valkey/management/connection/connection-details), and [Apache Kafka®](https://docs.vultr.com/products/storage/databases/kafka/management/connection/connection-details).

### Common Causes of Connection Refusal When Using Hostname

* **Incorrect Port Specification:** Each cluster uses a unique custom port. Using the wrong port in your connection string will cause the connection to be refused.

* **Trusted Sources Configuration:** By default, Vultr configures the Trusted Sources list to allow all incoming connections (`0.0.0.0/0`), so access is open unless modified. If you have restricted Trusted Sources, ensure your client’s IP or network range is included. Otherwise, connections will be blocked despite valid credentials. See the Trusted Sources documentation for [MySQL](https://docs.vultr.com/products/storage/databases/mysql/management/connection/trusted-sources), [PostgreSQL](https://docs.vultr.com/products/storage/databases/postgresql/management/connection/trusted-sources), [Valkey](https://docs.vultr.com/products/storage/databases/valkey/management/connection/trusted-sources), and [Apache Kafka®](https://docs.vultr.com/products/storage/databases/kafka/management/connection/trusted-sources) for details.

* **Virtual Private Cloud (VPC) Network Restrictions:** When your cluster is connected to a VPC, network access is further restricted to resources within that VPC. Clients outside the VPC must use the **public hostname** and be permitted by Trusted Sources to connect. Resources inside the same VPC can use the **private hostname** for direct, secure connectivity. Ensure clients using the private hostname are in the same Vultr account, region, and VPC network to avoid connection refusals. Refer to the engine-specific VPC network guides for [MySQL](https://docs.vultr.com/products/storage/databases/mysql/management/connection/vpc-networks), [PostgreSQL](https://docs.vultr.com/products/storage/databases/postgresql/management/connection/vpc-networks), [Valkey](https://docs.vultr.com/products/storage/databases/valkey/management/connection/vpc-networks), and [Apache Kafka®](https://docs.vultr.com/products/storage/databases/kafka/management/connection/vpc-networks) for instructions on configuring network access.
