Connection strings
The URL that tells a client where your database is, who you are and how to connect. Paste yours below to see how clients read it, or read how each engine’s format works.
Check a connection string
Paste a PostgreSQL, MySQL or MongoDB URL. It’s read here in your browser and never sent anywhere; the password is shown as dots.
- MongoDB connection string: mongodb:// and mongodb+srv:// explainedA MongoDB connection string lists the hosts directly (mongodb://user:password@host1:27017,host2:27017/db?replicaSet=rs0) or names one DNS entry that lists them for you (mongodb+srv://user:password@cluster0.example.net/). The +srv form also turns TLS on by default.
- MySQL connection string: mysql:// URLs, mysql flags and option filesApps and MySQL Shell take a URL, mysql://user:password@host:3306/database?options, but the query options differ from tool to tool. The mysql command-line client takes no URL at all: give it flags (-h, -P, -u, -p, --ssl-mode) or put them in an option file such as ~/.my.cnf.
- PostgreSQL connection string (URI and key/value) explainedA PostgreSQL connection string is a URI, postgresql://user:password@host:5432/dbname?sslmode=require, or the same settings as key/value pairs: host=… port=… dbname=…. psql, pg_dump and most drivers read both through libpq, with the same parameters.
- Special characters in database passwords: percent-encoding connection URLsIn a connection URL, characters such as @ : / ? # % in the password must be percent-encoded: p@ss:w/rd#100% becomes p%40ss%3Aw%2Frd%23100%25. Unencoded, the client either rejects the URL, connects to the wrong place, or quietly sends a different password.
- SQLite connection strings: file paths, file: URIs and in-memory databasesSQLite has no server, so its “connection string” is a file path, :memory:, or a file: URI such as file:data.db?mode=ro that adds options. URIs need URI support turned on in your library, and ? # % in file names must be percent-encoded.