Skip to content
All writing Part 02 of 09 · Reaching a Remote DB From Your Laptop
Engineering · 1 min read

The Connection URI Is Canonical; Flags Are It Decomposed

One connection URI carries all five coordinates and looks identical across engines. CLI flags are just that URI taken apart, with casing traps like -P port vs -p password.

One URI shape carries all five coordinates and looks identical across engines:

scheme://user:password@host:port/database

CLI flags are just this URI taken apart: -h=host, and port / user / db are the rest. The real trap is casing collisions:

  • psql: -p=port (lower), -U=user (upper), no password-value flag (use PGPASSWORD or the URI).
  • mysql: -P=port (UPPER), -p=password glued on (-pSecret; a space makes it the database name), -u=user.

From this session: psql postgresql://postgres:[email protected]:5433/demo_db worked verbatim, proof that using the URI sidesteps all flag-guessing.

Remember one URI; flags are just it taken apart. When unsure of a flag, hand it the URI.


References

Related: back to the remote DB overview; see the five coordinates and the MySQL CLI flags.

Tags #databases #cli
// connect

Be brave | Be wise | Be grateful

21 BreakinCode

// elsewhere
LinkedInMedium (lang: en)Life RecordYoutube
wh:~$William Hung· © 2026 Taipei · GMT+8 · Available for collaboration