DB Connection String Parser

DB Connection String Parser

Parse and build connection strings for PostgreSQL, MySQL, MongoDB (SRV), Redis, and SQL Server. Reconstructs masked and url-encoded variants.

Connection stringsamples:
Driver
postgresql
Username
app
Password
••••••
Hosts
db.example.com:5432
Database
myapp
Parameters
sslmoderequire
application_nameapi
Masked credentials
postgresql://app:***@db.example.com:5432/myapp?sslmode=require&application_name=api
URL-encoded
postgresql://app:[email protected]:5432/myapp?sslmode=require&application_name=api
Security checks
  • Password is short (<12 chars). Consider rotating to a longer secret.

What This Tool Does

DB Connection String Parser is built for deterministic developer and agent workflows.

Parse and build connection strings for PostgreSQL, MySQL, MongoDB (incl. SRV), Redis, and SQL Server. Exposes host, port, auth, database, params, SSL options, and reconstructs masked-credential and url-encoded variants.

Use How to Use for execution steps and FAQ for constraints, policies, and edge cases.

Last updated:

This tool is provided as-is for convenience. Output should be verified before use in any production or critical context.

Agent Invocation

Best Path For Builders

Browser workflow

Runs instantly in the browser with private local processing and copy/export-ready output.

Browser Workflow

This tool is optimized for instant in-browser execution with local data handling. Run it here and copy/export the output directly.

/db-connection-string-parser/

For automation planning, fetch the canonical contract at /api/tool/db-connection-string-parser.json.

How to Use DB Connection String Parser

  1. 1

    Paste a connection string

    Drop a DSN into the parse panel — postgresql://, mysql://, mongodb://, mongodb+srv://, redis://, rediss://, or sqlserver://. Sample buttons load a working example for each driver if you need a starting point.

  2. 2

    Inspect the parsed parts

    Driver, username, password, hosts (with default ports highlighted), database, and query parameters are extracted into a structured view. The password stays masked until you click reveal.

  3. 3

    Read the security checks

    The hints panel flags missing SSL/TLS, short passwords, privileged usernames (root/admin/sa), and dangerous params like sslmode=disable or trustServerCertificate=true. Use it as a quick pre-deploy review.

  4. 4

    Copy masked or url-encoded variants

    Two output panels show the connection string with the password masked (for sharing in tickets) and a fully url-encoded variant (for pasting into config files where reserved characters need escaping).

  5. 5

    Build a fresh DSN

    Switch to Build mode to assemble a connection string from fields. Pick the driver, fill credentials and hosts (multiple supported for MongoDB/Redis sentinels), set database, SSL mode, and extra params, then copy.

Frequently Asked Questions

Which connection string formats are supported?
URI form for postgresql, postgres, mysql, mongodb, mongodb+srv, redis, rediss, sqlserver/mssql. The sqlserver branch also accepts the legacy ADO-style 'Server=...;Database=...;User Id=...;Password=...;' format.
How does it handle special characters in passwords?
Userinfo is URL-decoded on parse, so %40 becomes @ and %24 becomes $. The url-encoded output panel re-encodes credentials so you can paste a safe variant into config files where reserved characters break parsing.
Why does mongodb+srv have no port?
SRV URIs resolve hosts and ports through DNS SRV records, so the URI itself must contain only one hostname and zero ports. The parser flags any port in an SRV URI as an error.
Does it send my data to a server?
No. Parsing, security checks, masked output, and the Build mode all happen in your browser. Credentials, hostnames, and database names never leave your device — important for production DSNs.
What security checks does it run?
It flags missing SSL/TLS, short passwords (under 12 chars), privileged usernames (root/admin/sa), and explicit downgrades like sslmode=disable or trustServerCertificate=true. Treat these as hints, not a full audit.