Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I am having problems with ogr2ogr and keep getting different versions of the error:

ERROR 1: MySQL error message: The used table type doesn't support SPATIAL indexes. Description: ALTER TABLE 'test_poly' ADD SPATIAL INDEX('SHAPE')

my command (entering it in FWTools Shell) is:

ogr2ogr -f "MySQL" MYSQL:"test,host=,user=root,port=3306" -nln test_poly -a_srs "EPSG:3857" -update -overwrite

...adding '-lco GEOMETRY_NAME ' doesn't do anything... ...also moving the ti tge ebdm behind -lco engine=MYSIAM does nothing...

All I see is the tables 'geometry_columns' and spatial_ref_sys' and 'test_poly' being created...but no data *(i.e. when I use "Select Rows - Limit 1000").

What am I missing?

I am a bit new to MySQL...but I read as much documentation as I could find...I thought I could set the spatial index by going to Engine: MYSIAM....am I wrong?

share|improve this question

1 Answer 1

up vote 2 down vote accepted



spatial indexes should be created on GEOMETRY types.

CREATE TABLE `test_poly` (
        `Id` int(11) NOT NULL, 
        `Name` varchar(255) NOT NULL, 
        `Location` GEOMETRY NOT NULL,
        PRIMARY KEY (`Id`),
        SPATIAL KEY (`Location`)

source: http://stackoverflow.com/questions/1282962/error-creating-spatial-index-on-mysql-blob-column

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.