db.connect(1)
π db.connect(1) β it's giving GRASS GIS User's Manual energy
okay bestie, welcome to db.connect, the GRASS GIS era of your life β¨ it prints and/or sets the general DB connection for the current mapset, which likeβ¦ is the whole vibe. π«Ά
β¨ NAME β¨
db.connect β prints/sets general DB connection for current mapset. periodt.
π·οΈ KEYWORDS π·οΈ
database, attribute table, connection settings πΈ
π¦ SYNOPSIS π¦
db.connect
db.connect --help
db.connect [-pgcd] [driver=name] [database=name] [schema=name]
[group=string] [--help] [--verbose] [--quiet] [--ui]
π Flags π
-pβ Print current connection parameters and exit. also, Substitute variables in database settings β¨-gβ Print current connection parameters using shell style and exit π₯-cβ Check connection parameters, set if uninitialized, and exit π-dβ Set from default settings and exit. it will Overwrite current settings if already initialized, no cap--helpβ Print usage summary π--verboseβ Verbose module output--quietβ Quiet module output π€«--uiβ Force launching GUI dialog π
π Parameters π
driver=nameβ Name of database driver- Options:
dbf,mesql,mysql,odbc,ogr,pg,sqlite - Default:
sqlite
- Options:
database=nameβ Name of database- Default:
$GISDBASE/$LOCATION_NAME/$MAPSET/sqlite/sqlite.db
- Default:
schema=nameβ Database schema- Do not use this option if schemas are not supported by driver/database server π«
group=stringβ Default group of database users to which select privilege is granted
π DESCRIPTION π
db.connect lets you set database connection parameters. once you do that, modules take those parameters as their default values, so you literally don't have to type them in every single time. main character energy for your workflow, fr fr. β¨
the default database backend in GRASS GIS is SQLite (since version 7). iconic. π
π NOTES π
values are stored in the mapset's VAR file; the connection is not tested for validity. so like, it will not check you, bestie π
the -p flag will display the current connection parameters. π¦
the -c flag will silently check if the connection parameters have been set, and if not, it will set them to use GRASS's default values. (useful in scripts before you attempt to create a new database table πΈ)
to connect a vector map to a database table, use v.db.connect or v.db.addtable. iykyk π«Ά
π EXAMPLES π
π SQLite (default backend)
Local storage:
db.connect -d
db.connect -p
db.tables -p
the SQLite database file is created automatically when used the first time. β¨
See SQLite database driver for details.
π PostgreSQL (local connection)
Local storage, database tables stored in database "mydb" (may require the use of db.login):
db.connect driver=pg database=mydb
db.login user=myname pass=secret
db.connect -p
db.tables -p
See PostgreSQL database driver for details.
π PostgreSQL (network connection)
Network storage, database tables stored in database "mydb" (may require the use of db.login):
db.connect driver=pg database=mydb
db.login user=myname pass=secret host=myserver.com port=6666
db.connect -p
db.tables -p
See PostgreSQL database driver for details.
π MySQL (local connection)
Local storage, database tables stored in database "mydb" (may require the use of db.login):
db.connect driver=mysql database=mydb
db.login user=myname pass=secret
db.connect -p
db.tables -p
See MySQL database driver for details.
π MySQL (network connection)
Network storage, database tables stored in database "mydb" (may require the use of db.login):
db.connect driver=mysql database=mydb
db.login user=myname pass=secret host=myserver.com
db.connect -p
db.tables -p
See MySQL database driver for details.
π ODBC
Network storage, database tables stored in database "mydb" (may require the use of db.login):
db.connect driver=odbc database=mydb
db.login user=myname pass=secret
db.connect -p
db.tables -p
See ODBC database driver for details.
π DBF (local, not recommended)
bestie. it literally says "not recommended" in the name. just so you know. π
Local storage (the dbf/ subdirectory in the mapset must exist or must be created by the user):
db.connect driver=dbf database=β$GISDBASE/$LOCATION_NAME/$MAPSET/dbf/β
db.tables -p
See DBF database driver for details.
π SEE ALSO π
db.columns, db.copy, db.drivers, db.login, db.tables, v.db.addtable, v.db.connect
GRASS SQL interface π
π AUTHORS π
- Main author: Radim Blazek, ITC-Irst, Trento, Italy
- GRASS 7 improvements: Martin Landa, Markus Metz
π SOURCE CODE π
Available at: db.connect source code (history)
Accessed: Saturday Jan 17 05:40:33 2026
Main index | Database index | Topics index | Keywords index | Graphical index | Full index
Β© 2003-2025 GRASS Development Team, GRASS GIS 8.4.2 Reference Manual
and that's the whole page, bestie π this was GRASS 8.4.2, page db.connect(1), last touched Saturday Jan 17 05:40:33 2026 β go set that connection, slay, and remember: values go in the mapset's VAR file and nobody's checking them for validity πβ¨π¦
π¦ 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