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'm trying to work with a MySQL 5.5 table using QGIS 1.8. I can do "Add Vector Layer", choose "Database", and successfully connect to the MySQL connection I previously set up. QGIS shows me a "Select vector layers to add" dialog that lists the tables in my database, including the one I want to use which shows a "Geometry type" of "Point" (which is correct, there's a POINT column in that table). When I highlight that table from the list and click OK I get an error message:

The layer MySQL:[redacted connection info] is not a valid layer and can not be added to the map

Is there something that needs to be done to make a MySQL table a "valid layer" other than making sure that it has a geometry field (like a point)?

share|improve this question
    
Can you make a connection directly with ogr? Try using ogrinfo to see what it tells you about the table. The syntax is to use is at the bottom of this page: gdal.org/ogr/drv_mysql.html –  HeyOverThere Nov 10 '12 at 17:11

1 Answer 1

Does your MySQL data have a MySQL spatial index? http://dev.mysql.com/doc/refman/5.0/en/create-index.html Additionaly do you have spatial extensions installed for MySQL? http://dev.mysql.com/doc/refman/5.0/en/spatial-extensions.html I don't know if this is the problem, but without more information I will offer it as a possible solution.

share|improve this answer

Your Answer

 
discard

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.