db.createdb.1grass man page

db.createdb — Creates an empty database.


database, attribute table, SQL


db.createdb --help
db.createdb driver=name database=name [--help] [--verbose] [--quiet] [--ui]


Print usage summary
Verbose module output
Quiet module output
Force launching GUI dialog


driver=name [required]
Name of database driver
Options: mesql, pg, dbf, sqlite, odbc, ogr, mysql
Default: sqlite
database=name [required]
Name of database


db.createdb allows the user to create a new empty database through different drivers. A working database connection needs to be established, see db.login.

Currently only SQLite and PostgreSQL database drivers are supported.


Create a new SQLite file-based database

Note that the standard GRASS GIS SQLite database is by default generated in the user’s current mapset. This example shows an out-of-mapset database file creation:

db.createdb driver=sqlite database=/opt/sqlite.db

Create a new PostgreSQL database

Create a new PostgreSQL database (after the PostgreSQL connection got established through the pg driver):

db.createdb driver=pg database=grassdb

Create a new PostgreSQL database (after the PostgreSQL connection got established through the odbc driver):

db.createdb driver=odbc database=grassdb


Support other database drivers, too.

See Also

db.columns, db.connect, db.describe, db.drivers, db.dropdb, db.droptable, db.execute, db.login, db.tables

GRASS SQL interface


Radim Blazek, ITC-Irst, Trento, Italy
SQLite and PostgreSQL support by Martin Landa, Czech Technical University in Prague, Czech Republic

Last changed: $Date: 2014-12-07 23:24:06 +0100 (Sun, 07 Dec 2014) $

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

© 2003-2016 GRASS Development Team, GRASS GIS 7.0.4 Reference Manual


GRASS 7.0.4 Grass User's Manual