---
name: "grass-mesql"
section: "1grass"
platform: "linux"
package: "grass-doc"
version: "6.4.4-1"
release: "Debian 8 (Jessie)"
platforms: ["linux"]
url: "https://new.carta.tech/grass-mesql"
---

# grass-mesql(1grass)

MySQL embedded driver MySQL embedded driver MySQL embedded driver in GRASS

## NAME

grass-mesql - MySQL embedded driver

MySQL embedded driver  MySQL embedded driver in GRASS

## KEYWORDS

database, attribute table, driver

## DESCRIPTION

MySQL database driver in GRASS enables GRASS to store vector attributes in MySQL embedded database without necessity  to run MySQL server.

## Driver and database name

GRASS modules require 2 parameters to connect to a database. Those parameters are 'driver' and 'database'. For MySQL embedded  driver the parameter 'driver' should be set to value 'mesql'. The parameter 'database' is a full path to the directory  where database tables are stored. The best place is  a directory in the mapset. The directory must be created  before use of the driver. In the name of database  it is possible to use 3 variables:

-

   $GISDBASE - path to current GISBASE

-

   $LOCATION\_NAME - name of current location

-

   $MAPSET - name of current mapset

Examples of connection parameters:\
 `db.connect driver=mesql database='$GISDBASE/$LOCATION_NAME/$MAPSET/mysql'`\
 `db.connect driver=mesql database=/home/user1/db`\

## Data types, indexes

For more information about supported data types and indexes see the documentation for MySQL (mysql) driver.

## Database type

Because database closing was found very slow if InnoDB was used, the InnoDB storage is disabled by default (hardcoded  ’--skip-innodb' server option).

## Note

The embedded server is started with hardcoded '--bootstrap' option to avoid warning about missing  "mysql.time\_zone\_leap\_second table". This can be fixed in future.

## Troubleshooting: SQL syntax error

Attempting to use a reserved SQL word as column or table name will result in a "SQL syntax" error. The list of reserved words for MySQL can be found in the MySQL manual.

## SEE ALSO

*db.connect,* *SQL support in GRASS GIS*

## Credits

Development of the driver was sponsored by Faunalia (Italy) as part of a project for ATAC.

## AUTHOR

Radim Blazek

*Last changed: $Date: 2014-02-15 23:27:05 +0100 (Sat, 15 Feb 2014) $*\
 Main index - database index - full index
