## DESCRIPTION

db.connect allows the user to set parameters for connection to database. These parameters are then taken by modules as default values and user do not need enter parameters each time. Values are stored in user file.

## OPTIONS

Typing db.connect -p displays current connection parameters.

## EXAMPLES

### DBF

(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

### ODBC

(may require the use of db.login):
db.connect driver=odbc database=gtest
db.login user=myname pass=secret
db.connect -p
db.tables -p

### PostgreSQL

(may require the use of db.login):
db.connect driver=pg database="host=myserver.itc.it,dbname=mydb"
db.login user=myname pass=secret
db.connect -p
db.tables -p

### PostgreSQL with different port

(may require the use of db.login):
db.connect driver=pg database="host=myserver.itc.it,dbname=mydb,port=6666"
db.login user=myname pass=secret
db.connect -p
db.tables -p

## NOTES

To connect a vector map to a database table, use v.db.connect.

## SEE ALSO

db.columns, db.drivers, db.login, db.tables, v.db.connect, GRASS SQL interface

## AUTHOR

Radim Blazek, ITC-Irst, Trento, Italy

Last changed: $Date: 2005/10/19 09:00:29 $