I want to import data from MySQL DB. MySQL schema has a lot of tables with a huge amount of data. This is non spatial data. I want to import objects as vector layers using sql query which is selecting and joining only what I need. Is it possible to do?

I`ve tried to use Layer->Add Vector Layer ...> MySQL database. But QGIS get crashed in this case (Import MySQL data to QGIS with a plugin). Indeed, my db has not vector data, it has only tables with longitude, latitude columns.

I`ve tried to use DB Manager plugin but its help says that only four predefined dbms backends are supported (db_manager github) and no MySQL DBMS listed there.

  • Is your spatial data in same same database? If yes , then create view data as select * from spatialdata left join moredata and create layer from it or export table as csv , import it with delimited text layer (select no geometry) and do join in layer properties. I dont see anyother options with mysql, postgresql and other databases have better support in qgis, maybe move data to postgresql for spatial analysis ? – simplexio Feb 21 '17 at 13:36
  • I have not any spatial data in the db. Only tables with and without coordinates of points. – E Bobrov Feb 22 '17 at 7:59
  • Anyway thank you. Will try to get csv from mysql with python script inside QGIS and then import it as a layer. – E Bobrov Feb 22 '17 at 8:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.