Picture Guides to Connection Strings

A connection string is a single line of text, which makes it easy to misread. Drawing it out, part by part, helps enormously. This gallery lists the visual explanations on this site, each with a caption.

The labelled string

Picture: a connection string with a coloured label under each piece: scheme, user, password, host, port, database.

Where to see it: Reading a Connection String Piece by Piece

Caption: once each part has a name, a confusing line becomes six simple facts.

Three shapes of the same information

Picture: the same details written as a URI, as key-value pairs and as a JDBC URL, stacked one above the other with matching colours.

Where to see it: Weighing Choices: URI, Key-Value and JDBC Connection Strings

Caption: shows that the formats differ in punctuation, not in meaning.

Where the secret lives

Picture: a code file with a padlock-shaped hole where the password used to be, and an arrow from an environment variable filling it at run time.

Where to see it: How to Keep a Connection String in an Environment Variable

Caption: the code stays shareable; the secret stays on the machine that runs it.

The live generator

Picture: a form on the left, the finished string on the right, updating as you type.

Where to see it: the connection string generator

Caption: experiment with different databases and watch which parts change.

The error map

Picture: a flowchart from "can't connect" through five yes-or-no checks: server running, host, port, login, driver.

Where to see it: Diagnosing Your First Can't Connect Error

Caption: follow the arrows until one answer is "no". That is usually your problem.

Laptop to hosting

Picture: two connection strings, one for a laptop and one for a hosted server, with the differences circled.

Where to see it: Example Walkthrough: Moving a Connection String From Laptop to Hosting

Caption: host, port, password and encryption usually change; the shape stays the same.

Suggested order

GoalStart withThen
Understand any stringThe labelled stringThree shapes
Keep secrets safeWhere the secret livesLaptop to hosting
Fix a failing connectionThe error mapThe live generator

Draw your own

Write your own connection string on paper with the password replaced by ****. Under each part, write its name. If you can label every piece, you are ready to debug almost any connection problem on your own.

A free learning page for beginners. Practise on a test database, never on real customer data, and check the official documentation for your database version.