db.login(1)
π db.login β the GRASS GIS bestie guide π
okay so you found the db.login(1) page in the GRASS GIS User's Manual and honestly? iconic of you. this little guy handles your database login glow-up: user, password, and all the connection settings. let's get into it π«Ά
β¨ NAME β¨
db.login β sets user/password for DB driver/database. that's it, that's the whole job. lowkey essential π
π·οΈ 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 the connection settings and then dip. that's it, that's all it does β¨--overwriteβ allow output files to overwrite existing files--helpβ print the usage summary--verboseβ verbose module output (she's chatty)--quietβ quiet module output (she's mysterious)--uiβ force launching the GUI dialog
π¦ Parameters π¦
driver=name[required] β the name of your database driver.- Options:
dbf,mesql,mysql,odbc,ogr,pg,sqlite - Default:
sqlite
- Options:
database=name[required] β the name of your database.- Default:
$GISDBASE/$LOCATION_NAME/$MAPSET/sqlite/sqlite.db
- Default:
user=stringβ your usernamepassword=stringβ your passwordhost=stringβ the hostname. relevant only for thepgandmysqldrivers, no capport=stringβ the port. also only relevant forpgandmysql
π DESCRIPTION π
so like, db.login sets login parameters β things like your user name, and optionally a password, a hostname, or a port β for connecting to the database you picked, through that DB driver. it's basically setting up your lil connection fit before you go out π
π¨ NOTE π¨
the host and port options are related to only SQL database backends, like PostgreSQL, MySQL or ODBC. so if you're not on one of those, don't stress about them bestie.
β οΈ okay this part matters, listen up: the passwords are stored in a hidden, unencrypted file in the user account. unencrypted. not encrypted. we're saying it twice because it's important. specifically it lives: - in the 'home' directory, i.e.$HOME/.grass8/dbloginon Unix-like systems -%APPDATA%\Roaming\GRASS8\dbloginon MS-Windows only the file owner can access this file. π but still. unencrypted. you've been warned.
π₯ EXAMPLES π₯
only username specified (this is assuming a locally accessible PostgreSQL DB with no password):
db.login driver=pg database=mydb
username, password and hostname all specified β and heads up, the command lines history will store the password this way:
db.login driver=pg database=mydb user=bacava password=secret host=db.example.com
username with an empty password specified:
db.login driver=pg database=mydb user=bacava password=""
π SEE ALSO π
db.connect, db.test, db.tables
SQL support in GRASS GIS
π AUTHOR π
Radim Blazek
Support for hostname and port by Martin Landa, OSGeoREL, Czech Technical University in Prague, Czech Republic (GRASS 7.1) β slay π«Ά
π§ SOURCE CODE π§
Available at: db.login source code (history)
Accessed: Saturday Jan 17 05:40:33 2026
Main index | Database index | Topics index | Keywords index | Graphical index | Full index
and that's the whole page bestie, you ate π β¨ mwah π
this was GRASS 8.4.2, the db.login(1) page from the GRASS GIS 8.4.2 Reference Manual, Β© 2003-2025 GRASS Development Team β go forth and connect responsibly πΈπ¦
π¦ where this page comes from
- fedora 44: grass 8.4.2-4.fc44 Β· 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