GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
db.connect(1) GRASS GIS User's Manual db.connect(1)

db.connect - Prints/sets general DB connection for current mapset.

database, attribute table, connection settings

db.connect
db.connect --help
db.connect [-pgcd] [driver=name] [database=name] [schema=name] [group=string] [--help] [--verbose] [--quiet] [--ui]


Print current connection parameters and exit
Substitute variables in database settings

Print current connection parameters using shell style and exit

Check connection parameters, set if uninitialized, and exit

Set from default settings and exit
Overwrite current settings if already initialized

Print usage summary

Verbose module output

Quiet module output

Force launching GUI dialog


Name of database driver
Options: dbf, ogr, pg, sqlite
Default: sqlite

Name of database
Default: $GISDBASE/$LOCATION_NAME/$MAPSET/sqlite/sqlite.db

Database schema
Do not use this option if schemas are not supported by driver/database server

Default group of database users to which select privilege is granted

db.connect allows the user to set database connection parameters. These parameters are then taken as default values by modules so that the user does not need to enter the parameters each time.

The default database backend in GRASS GIS is SQLite (since version 7).

Values are stored in the mapset’s VAR file; the connection is not tested for validity.

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 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.

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.

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.

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.

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.

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.

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.

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.

db.columns, db.copy, db.drivers, db.login, db.tables, v.db.addtable, v.db.connect

GRASS SQL interface

Main author: Radim Blazek, ITC-Irst, Trento, Italy
GRASS 7 improvements: Martin Landa, Markus Metz

Available at: db.connect source code (history)

Latest change: Tuesday Dec 17 20:17:20 2024 in commit: d962e90c026708a4815ea2b9f46c0e84c17de22d

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

© 2003-2025 GRASS Development Team, GRASS GIS 8.4.1 Reference Manual

GRASS 8.4.1

Search for    or go to Top of page |  Section 1 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.