grass-mesql(1)

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

πŸ’Ύ 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