# MySQL Spatial

<table data-header-hidden><thead><tr><th width="115.5"></th><th></th></tr></thead><tbody><tr><td>Read</td><td>Yes</td></tr><tr><td>Write</td><td>Yes</td></tr></tbody></table>

JMap Server can connect to MySQL Spatial databases to extract spatial data and attributes to be used as a spatial data source. The only special requirement is the presence of a numeric column with unique integer values to use as element identifiers. An SQL query must be provided. This query will be executed to read the data and it can access one or many tables at the same time.

The connection to the database must be already configured. See [Creating Databases](/e/administrator/jmap-server-administrator-manual/resources-databases/creating-databases.md) for more information on this topic.

<table data-header-hidden><thead><tr><th width="197.5"></th><th></th></tr></thead><tbody><tr><td>Database</td><td>Select the MySQL database to read the data from. It must already be configured in JMap Admin.</td></tr><tr><td>SQL query</td><td>Enter the SQL query used to extract geometries and attributes from the database.</td></tr><tr><td>Geometry table</td><td>Select the physical table that contains the geometries. Pressing <strong>Load</strong> will retrieve the list of fields returned by the query. This action is necessary to configure the rest of the parameters.</td></tr><tr><td>Geometry field</td><td>Select the field that contains the geometries.</td></tr><tr><td>Id field</td><td>Select a field that contains unique identifiers. Only integer fields are listed.</td></tr><tr><td>Creation time field</td><td>(Optional) If you want this data source to be editable by JMap, this field will show the creation date of each object. If no field is selected, the data can still be edited, but this information will not be maintained.</td></tr><tr><td>Modification date field</td><td>(Optional) If you want this data source to be editable by JMap, this field will contain the date each object was last modified. If no field is selected, the data can still be edited, but this information will not be maintained.</td></tr><tr><td>Author field</td><td>(Optional) If you want this data source to be editable by JMap, this field will either contain the name of the user who created each object or the name of the user who made the last change. If no field is selected, the data can still be edited, but this information will not be maintained.</td></tr></tbody></table>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs-jmapserver-lima.k2geospatial.com/e/administrator/jmap-server-administrator-manual/resources-spatial-data/vector-data-sources/mysql-spatial.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
