1db.login(1) Grass User's Manual db.login(1)
2
3
4
6 db.login - Sets user/password for DB driver/database.
7
9 database, connection settings
10
12 db.login
13 db.login --help
14 db.login [-p] driver=name database=name [user=string] [pass‐
15 word=string] [host=string] [port=string] [--overwrite] [--help]
16 [--verbose] [--quiet] [--ui]
17
18 Flags:
19 -p
20 Print connection settings and exit
21
22 --overwrite
23 Allow output files to overwrite existing files
24
25 --help
26 Print usage summary
27
28 --verbose
29 Verbose module output
30
31 --quiet
32 Quiet module output
33
34 --ui
35 Force launching GUI dialog
36
37 Parameters:
38 driver=name [required]
39 Name of database driver
40 Options: dbf, mesql, mysql, odbc, ogr, pg, sqlite
41 Default: sqlite
42
43 database=name [required]
44 Name of database
45 Default: $GISDBASE/$LOCATION_NAME/$MAPSET/sqlite/sqlite.db
46
47 user=string
48 Username
49
50 password=string
51 Password
52
53 host=string
54 Hostname
55 Relevant only for pg and mysql driver
56
57 port=string
58 Port
59 Relevant only for pg and mysql driver
60
62 db.login sets login parameters such an user name and optionally also a
63 password, a hostname or a port for the connection to the selected data‐
64 base through the DB driver.
65
67 Options host and port are related to only SQL database backends like
68 PostgreSQL, MySQL or ODBC.
69
70 Note that the passwords are stored in a hidden, unencrypted file in the
71 user account, specifically
72
73 · in the ’home’ directory, i.e. $HOME/.grass7/dblogin (Unix-like
74 systems)
75
76 · %APPDATA%/GRASS7/dblogin (MS-Windows)
77 Only the file owner can access this file.
78
80 Only username specified (assuming locally accessible PostgreSQL DB
81 without password):
82 db.login driver=pg database=mydb
83
84 Username, password and hostname specified (note that the command lines
85 history will store the password in this way):
86 db.login driver=pg database=mydb user=bacava password=secret host=db.example.com
87
88 Username and empty password specified:
89 db.login driver=pg database=mydb user=bacava password=""
90
92 db.connect, db.test, db.tables
93
94 SQL support in GRASS GIS
95
97 Radim Blazek
98 Support for hostname and port by Martin Landa, OSGeoREL, Czech Techni‐
99 cal University in Prague, Czech Republic (GRASS 7.1)
100
102 Available at: db.login source code (history)
103
104 Main index | Database index | Topics index | Keywords index | Graphical
105 index | Full index
106
107 © 2003-2019 GRASS Development Team, GRASS GIS 7.8.2 Reference Manual
108
109
110
111GRASS 7.8.2 db.login(1)