Connect to your database and set up the firewall

Apps in the same project connect over the internal network. To connect from outside, turn on the public endpoint and allow your IP.

From services in the same project

Use the internal name server-name.internal or the private IP. If you link the database to a container, the variables DATABASE_URL, DB_HOST, DB_PORT, DB_USER, DB_PASSWORD and DB_NAME are added for you.

From your computer or outside systems

  1. Open the Connectivity & firewall tab and turn on the public endpoint.
  2. Add the allowed IPs, such as 203.0.113.10 or a range like 203.0.113.0/24 (up to 50 entries).
  3. Copy the connection string and use it. Connections must use TLS.
URL
postgresql://USER:PASSWORD@HOST:5432/DB?sslmode=require
mysql://USER:PASSWORD@HOST:3306/DB?ssl-mode=REQUIRED

If there are no IPs in the firewall list at all, every connection from outside is refused.

Studio and importing data

In the Studio tab you can view tables and run SQL right from the Console, after signing in with the database user name and password. The Import tab takes files from pg_dump or mysqldump, no larger than your disk (up to 50 GB).

If something goes wrong

I can’t connect; it says “client address is not allowed by the firewall rules”

Your IP isn’t in the firewall list yet. Check your current IP (home and mobile IPs can change), then add it in the Connectivity & firewall tab.

It says “public access is disabled for this database”

The public endpoint isn’t turned on. Turn it on in the Connectivity & firewall tab, or connect over the internal network instead.

It says “server name is required”

Your program isn’t sending the server name over TLS. Connect using the full host name with TLS turned on, or use a username like user@server-name.

It says “database server uses a different protocol on this port”

You’re using the wrong port for the engine: PostgreSQL 5432 · MySQL/MariaDB 3306 · Managed Cache 6379

It says “database server is not reachable”

The database may be stopped or restarting. Check its status on the overview page, then try again.

The firewall says the format is invalid

Enter a single IP, such as 203.0.113.10, or a CIDR range, such as 203.0.113.0/24.

Still stuck? Let our team help

Open a ticket from the Console. Tell us the site or service, what you did and the message on screen. Our reply comes back in the same ticket, so everything stays in one place.