db.login(1grass)

πŸ’– db.login β€” the GRASS User's Manual glow-up πŸ’–

okay bestie, welcome to db.login(1grass), the little module that handles your database login vibes. It sets the user/password for a DB driver/database. That's literally it. And it eats. ✨


✨ NAME ✨

db.login β€” Sets user/password for DB driver/database. πŸ’…

🏷️ KEYWORDS 🏷️

database, connection settings


🌸 SYNOPSIS 🌸

db.login
db.login --help
db.login [-p] driver=name database=name  [user=string]
[password=string]   [host=string]   [port=string]   [--overwrite]
[--help]  [--verbose]  [--quiet]  [--ui]

πŸŽ€ Flags πŸŽ€

  • -p β€” Print connection settings and exit. Just peek, don't touch. πŸ‘€
  • --overwrite β€” Allow output files to overwrite existing files. It's giving bold. πŸ”₯
  • --help β€” Print usage summary. Your friendly lil manual, but in the terminal.
  • --verbose β€” Verbose module output. It will NOT stop talking and honestly? iconic.
  • --quiet β€” Quiet module output. The introvert setting. 🀫
  • --ui β€” Force launching GUI dialog. Clicks over typing, we love that for you. 🫢

🧚 Parameters 🧚

  • driver=name [required] β€” Name of database driver. Options: dbf, mysql, odbc, ogr, pg, sqlite Default: sqlite
  • database=name [required] β€” Name of database. Default: $GISDBASE/$LOCATION_NAME/$MAPSET/sqlite/sqlite.db
  • user=string β€” Username.
  • password=string β€” Password. (yes bestie, we will talk about where this ends up, keep scrolling 😭)
  • host=string β€” Hostname. Relevant only for pg and mysql driver.
  • port=string β€” Port. Relevant only for pg and mysql driver.

πŸ¦‹ DESCRIPTION πŸ¦‹

So db.login sets login parameters β€” like a user name, and optionally a password, a hostname, or a port β€” for the connection to the selected database through the DB driver. That's the whole job. Lowkey essential, highkey underrated. ⭐


πŸ’€ NOTE πŸ’€

The options host and port are related to only SQL database backends like PostgreSQL, MySQL or ODBC. So if you're not on one of those, don't come for them, they're not relevant to you. πŸ™ˆ

okay so now the part that matters: the passwords are stored in a hidden, unencrypted file in the user account. Unencrypted. Not a metaphor. Not a drill. πŸ’€

Specifically, it lives:

  • in the 'home' directory, i.e. $HOME/.grass8/dblogin (Unix-like systems)
  • %APPDATA%\Roaming\GRASS8\dblogin (MS-Windows)

Only the file owner can access this file. So like, keep it cute, keep it yours. πŸ”’


🌈 EXAMPLES 🌈

Only username specified (assuming locally accessible PostgreSQL DB without password):

db.login driver=pg database=mydb

Username, password and hostname specified (note that the command lines history will store the password in this way):

db.login driver=pg database=mydb user=bacava password=secret host=db.example.com

Username and empty password specified:

db.login driver=pg database=mydb user=bacava password=""

πŸ‘‘ SEE ALSO πŸ‘‘

db.connect, db.test, db.tables

SQL support in GRASS


πŸ’œ AUTHOR πŸ’œ

Radim Blazek

Support for hostname and port by Martin Landa, OSGeoREL, Czech Technical University in Prague, Czech Republic (GRASS 7.1)


πŸ“ SOURCE CODE πŸ“

Available at: db.login source code (history)

Latest change: Friday Aug 08 09:39:19 2025 in commit: ed72c71d8580e872cd6fd345c84a15c324764465

Main index | Database index | Topics index | Keywords index | Graphical index | Full index


and that's the whole page, bestie!! πŸŽ€ this was db.login from the GRASS 8.5.0 Reference Manual, Β© 2003-2026 GRASS Development Team, brought to you by GRASS 8.5.0 β€” mwah, go set your login params, ily, bye πŸ’–βœ¨πŸ¦‹

πŸ“¦ where this page comes from