Connection String Builder
Database Config
Generated Strings
Share MySysAd

⚠️ IMPORTANT DISCLAIMER: The tools and scripts on this site are provided "AS IS" for educational purposes.

Review destructive commands before executing. By using this site, you assume all risk and agree to our Full Terms of Service.

Connection strings without the guesswork

Every database has its own URI format, default port and options, and one unescaped @ in a password breaks the whole string. Fill in the host, port, database and credentials and get the URI, a .env line and code snippets for Python and Node.js.

Common questions

What is the PostgreSQL connection string format?

postgresql://user:password@host:5432/dbname?sslmode=require, where sslmode can be disable, require, verify-ca or verify-full. MySQL is mysql://user:password@host:3306/dbname, MongoDB is mongodb://user:password@host:27017/dbname?authSource=admin (or mongodb+srv:// for Atlas), and SQL Server uses key-value pairs such as Server=host,1433;Database=db;User Id=user;Password=…;Encrypt=True.

How do I use special characters like @ or # in a password?

Percent-encode them: @ becomes %40, : becomes %3A, / becomes %2F, # becomes %23 and % itself becomes %25. Otherwise the parser reads the @ as the start of the host name. The builder encodes them for you.

What does authSource=admin mean in a MongoDB URI?

It tells the driver which database holds the user’s credentials. Users created in the admin database need authSource=admin even when you connect to a different database; without it you get “Authentication failed”.

What is the Redis connection URL format?

redis://:password@host:6379/0, where the number at the end is the database index. Use rediss:// (two s’s) for TLS, and put the user name before the colon for Redis 6 ACL users: redis://user:password@host:6379/0.

Where should I keep a connection string?

Out of source code: in an environment variable, in a .env file that’s listed in .gitignore, or in a secrets manager. If a string with a real password was ever committed to Git, change the password.

Related tools: Data Transformer (URL encoding) · Port Reference · All tools A–Z