4

I have been trying to load spatial data to mysql 8 db and seems like it is not working. the import data section basically does not move from 0% but the tables are created with null values on every columns. Anyone know why this is happening? The steps I followed are as below:

  1. Load spatial data screenshot
  2. selecting the shapefile to import screenshot
  3. import options screenshot
  4. after i press import, i can see that the file is getting uploaded through activity monitor screenshot of activity monitor with the amount of data uploaded
  5. however the import data progress does not move from 0 percent even after waiting for few hours screenshot
  6. upon checking the db, there is in fact a new table created using the shape file i uploaded screenshot
  7. however, the values inside each and every column is null screenshot of table
Travalour
  • 93
  • 1
  • 8

2 Answers2

2

It looks like it's just a wrapper around ogr2ogr. Try using the tool directly (it's FOSS, so you can grab it freely).

Then take a look at: How to Import shape file into MySQL

And maybe: https://www.gdal.org/drv_mysql.html

And https://www.igismap.com/insert-shapefile-in-mysql-as-spatial-data/

That all said, MySQL is very poor at handling spatial data. If you have any choice, use PostGreSQL and PostGIS instead.

GIS-Jonathan
  • 4,347
  • 11
  • 31
  • 45
2

For anyone who comes to this question, I found the answer yesterday.

  1. The import will not work if the charset of DB and shape file you are trying to import are not the same.
  2. The CRS string line in the PRJ file is not recogonizable for MySQL.

Refer to the below videos for a step by step instrction: 1. https://www.youtube.com/watch?v=qC7OXFTkUW0&t=571s 2. https://www.youtube.com/watch?v=ZCVzCBeaHAE

Travalour
  • 93
  • 1
  • 8