grass-mesql(1)

πŸ“¦
version 8.4.2 Β· 3 versions
, in fedora 44

πŸ’… grass-mesql β€” MySQL embedded driver ✨

okay bestie, welcome to the GRASS GIS User's Manual page for grass-mesql, aka the MySQL embedded driver. grab a snack, this one's cute AND useful 🫢

🌸 MySQL embedded driver

So like. The MySQL database driver lets GRASS store vector attributes in a MySQL embedded database β€” no MySQL server running required. no server, no drama, no systemctl meltdown. it's giving self-sufficient queen πŸ‘‘

πŸ”Œ Driver and database name

GRASS modules need 2 parameters to connect to a database, bestie. those parameters are 'driver' and 'database'.

  • For the MySQL embedded driver, the 'driver' parameter should be set to the value mesql. yes, mesql, not mysql. iykyk.
  • The 'database' parameter is a full path to the directory where database tables are stored. the best place for it is a directory in the mapset. and listen β€” the directory must be created before use of the driver. it will not make itself. it is not that girl. create it first πŸ’…

And 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, copy them exactly bestie:

db.connect driver=mesql database='$GISDBASE/$LOCATION_NAME/$MAPSET/mysql'
db.connect driver=mesql database=/home/user1/db

πŸ“Š Data types, indexes

For more info about supported data types and indexes, go check the documentation for the MySQL (mysql) driver. that's the main character, this is the spinoff ✨

πŸ—„οΈ Database type

Okay so tea time: because database closing was found very slow when InnoDB was used, the InnoDB storage is disabled by default β€” it's hardcoded with the --skip-innodb server option. not a config you toggle, a whole hardcoded vibe. periodt πŸ’€

πŸ“Œ Note

The embedded server is started with the hardcoded --bootstrap option, and that's specifically to avoid the warning about the missing "mysql.time_zone_leap_second table". this can be fixed in future. for now it just... is. πŸ™ˆ

🚨 Troubleshooting: SQL syntax error

If you try to use a reserved SQL word as a column or table name, you're gonna get a "SQL syntax" error. that's it, that's the whole thing. the list of reserved words for MySQL lives in the MySQL manual β€” go peek before you name anything order or select, i'm begging 😭


πŸ‘‘ AUTHOR

Radim Blazek

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

πŸ”— 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 a wrap bestie πŸŽ€ this was the grass-mesql(1) page from the GRASS GIS 8.4.2 Reference Manual, Β© 2003-2025 GRASS Development Team. version 8.4.2, slayed as always. go forth and embed ur MySQL πŸ’–βœ¨πŸ¦‹

πŸ“¦ where this page comes from