Cloud & Databases

CLOUD & DATABASES

Connection string builder

Build connection strings for PostgreSQL, MySQL/MariaDB, SQL Server, MongoDB and Redis in the formats your driver expects – URI, JDBC, .NET, SQLAlchemy and more. Special characters in passwords are escaped correctly for each format.

Database

Connection strings

CHANGE_ME is a placeholder – enter the real password or replace it later.

URI (libpq, psql, Prisma, Node pg)

postgresql://app_user:CHANGE_ME@db.example.com:5432/app?sslmode=verify-full

libpq keyword/value

host=db.example.com port=5432 dbname=app user=app_user password=CHANGE_ME sslmode=verify-full

JDBC

jdbc:postgresql://db.example.com:5432/app?user=app_user&password=CHANGE_ME&sslmode=verify-full

.NET (Npgsql)

Host=db.example.com;Port=5432;Database=app;Username=app_user;Password=CHANGE_ME;SSL Mode=VerifyFull

SQLAlchemy (psycopg 3)

postgresql+psycopg://app_user:CHANGE_ME@db.example.com:5432/app?sslmode=verify-full

Environment (libpq)

PGHOST=db.example.com
PGPORT=5432
PGDATABASE=app
PGUSER=app_user
PGPASSWORD=CHANGE_ME
PGSSLMODE=verify-full

Everything is generated locally in your browser; passwords are never sent to a server.

Frequently asked questions

Why does my password break the connection string?

Characters like the at sign, colon, slash, ?, # or % have a meaning in URIs. Unescaped, an at sign in the password ends the user part early and the host is parsed incorrectly. In URIs they must be percent-encoded (the at sign becomes %40); other formats use quotes or braces instead. This tool applies the right escaping for each format.

What is the difference between URI and keyword/value format?

A URI like postgresql://… is compact and used by most drivers and frameworks. The keyword/value format (host=… dbname=…) of libpq or the semicolon-separated format of .NET lists every setting by name and needs quoting instead of percent-encoding.

Which sslmode should I use for PostgreSQL?

verify-full: it encrypts the connection and checks that the server certificate is trusted and matches the host name. require only encrypts and is open to man-in-the-middle attacks; prefer and disable may connect without encryption.

When do I need mongodb+srv?

mongodb+srv:// looks up the hosts of a replica set via DNS SRV records and the options via a TXT record, so the URI only needs the cluster name and no port. MongoDB Atlas uses this format; TLS is enabled by default.

Is it safe to enter my password here?

The connection strings are generated in your browser; nothing is sent to the server. Still, avoid storing passwords in connection strings in code repositories – use environment variables or a secret store instead.