Does MySQL or MariaDB support GIS KNN Index Queries (k-nearest neighbors)?
In short, neither MySQL or MariaDB do. They do use R-Trees so it doesn't sound impossible to implement. I haven't seen this feature request in either of their bug trackers.