Scroll to navigation

db.login(1grass) GRASS GIS User's Manual db.login(1grass)

NAME

db.login - Sets user/password for DB driver/database.

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:


Print connection settings and exit

Allow output files to overwrite existing files

Print usage summary

Verbose module output

Quiet module output

Force launching GUI dialog

Parameters:


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

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

Username

Password

Hostname
Relevant only for pg and mysql driver

Port
Relevant only for pg and mysql driver

DESCRIPTION

db.login sets login parameters such an user name and optionally also a password, a hostname or a port for the connection to the selected database through the DB driver.

NOTE

Options host and port are related to only SQL database backends like PostgreSQL, MySQL or ODBC.

Note that the passwords are stored in a hidden, unencrypted file in the user account, specifically

  • in the ’home’ directory, i.e. $HOME/.grass8/dblogin (Unix-like systems)
  • %APPDATA%\Roaming\GRASS8\dblogin (MS-Windows)
Only the file owner can access this file.

EXAMPLES

Only username specified (assuming locally accessible PostgreSQL DB without password):

db.login driver=pg database=mydb

Username, password and hostname specified (note that the command lines history will store the password in this way):

db.login driver=pg database=mydb user=bacava password=secret host=db.example.com

Username and 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)

SOURCE CODE

Available at: db.login source code (history)

Accessed: Sunday Jan 22 07:35:50 2023

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

© 2003-2023 GRASS Development Team, GRASS GIS 8.2.1 Reference Manual

GRASS 8.2.1