grass-mesql(1)
πΎ grass-mesql(1) β the GRASS GIS User's Manual, but make it cute β¨
okay bestie, gather round, because today we're talking about the MySQL embedded driver in GRASS GIS 8.4.2 and honestly? it's giving convenience. π
πΈ MySQL embedded driver πΈ
The MySQL database driver lets GRASS store vector attributes in a MySQL embedded database β no MySQL server required, no cap. it just... lives inside your mapset like a lil roommate. π«Ά
π Driver and database name
So here's the tea: GRASS modules need 2 parameters to connect to a database. Those parameters are driver and database. β¨
- for the MySQL embedded driver, the driver parameter has to be set to the value
mesql. that's the vibe check. no substitutions. - the database parameter is a full path to the directory where the database tables are stored. the best place for it? a directory in the mapset, periodt. π
β οΈ bestie listen β the directory must be created before use of the driver. it will not create itself. it is not that girl.
In the name of the database you can 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
like... look at her. iconic. ππ
π§ Data types, indexes
For more info about supported data types and indexes, go check the documentation for the MySQL (mysql) driver. that's where the details live, iykyk. π
ποΈ Database type
Okay so real talk: database closing was found very slow if InnoDB was used π, so the InnoDB storage is disabled by default β it's hardcoded with the --skip-innodb server option. that's just how she is. π
π Note
The embedded server is started with a hardcoded --bootstrap option, and the whole reason is to avoid the warning about the missing "mysql.time_zone_leap_second table". This can be fixed in future. π (foreshadowing, bestie.)
π¨ Troubleshooting: SQL syntax error
If you try to use a reserved SQL word as a column or table name, you're gonna get an "SQL syntax" error. that's not a you problem, that's just SQL being SQL. π
The list of reserved words for MySQL can be found in the MySQL manual. go peek before you name your column order. please. π₯²
π AUTHOR
Radim Blazek
Credits: Development of the driver was sponsored by Faunalia (Italy) as part of a project for ATAC. shoutout to the sponsors, they ate. π«Άβ¨
π SEE ALSO
db.connect- SQL support in GRASS GIS
π SOURCE CODE
Available at: MySQL embedded driver source code (history)
Accessed: Saturday Jan 17 05:40:32 2026
Main index | Topics index | Keywords index | Graphical index | Full index
and that's the whole page, bestie π this was grass-mesql(1) from the GRASS GIS 8.4.2 Reference Manual, Β© 2003-2025 GRASS Development Team β go forth and embed your MySQL, you absolute main character. ππ¦π
π¦ where this page comes from
- fedora 44: grass 8.4.2-4.fc44 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms