NAME

db.connect - Connect to the database through DBMI.
(GRASS DB Program)

SYNOPSIS

db.connect
db.connect help
db.connect [-p] [driver=name] [database=name] [location=name] [user=name] [password=name] [key=name]

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

When invoked simply as db.connect, the program prompts the user for parameters. The user can run the program non-interactively, specifying the (optional) flag setting and parameters values on the command line. Program flag and parameters are described below.

Flags:

-p
Print only current settings.

Parameters:

driver=name
The name of a DBMI driver. Drivers are specified in dbmscap file. Each driver is specified in dmbscap file on one row in following format:
driver_name:full_path_to_the_driver:driver_description
for example:
odbc:/usr/local/grass5b5/driver/odbc:odbc driver
local:/tmp/dbmi/driver/informix:informix
diego:/usr/ucb/rsh diego /tmp/dbmi/driver/informix:informix    
db.connect searches for the dbmscap file in locations in following order:
value of variable DBMSCAP
/etc/dbmscap
/lib/dbmscap
/usr/lib/dbmscap
/usr/local/lib/dbmscap
/usr/local/dbmi/lib/dbmscap
and uses first one found. You can use db.drivers to list drivers defined in dbmscap file.

database=name
The name of a database. You can use db.databases to list available databases.

location=name
The location of the database.

user=name
The database user name (login).

password=name
The database user password. Warning: password is saved in .grassrc in readable form!!!

key=name
The key column name. Key column is column corresponding to categories.

EXAMPLE

db.connect driver=odbc database=gtest key=id

SEE ALSO

db.drivers db.databases

AUTHOR

Radim Blazek