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,sqliteDefault:sqlitedatabase=name[required] β Name of database. Default:$GISDBASE/$LOCATION_NAME/$MAPSET/sqlite/sqlite.dbuser=stringβ Username.password=stringβ Password. (yes bestie, we will talk about where this ends up, keep scrolling π)host=stringβ Hostname. Relevant only forpgandmysqldriver.port=stringβ Port. Relevant only forpgandmysqldriver.
π¦ 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
- alpine 3.24: grass-gis-doc 8.5.0-r1 Β· GPL-2.0-or-later
- ubuntu stonking: grass-doc 8.5.0-1ubuntu1 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms