[GIS] Error during conversion of shapefile to MySQL using ogr2ogr

errorgdalMySQLogrogr2ogr

I have installed MS4W in Windows 7. I get an error when I try to convert a shapefile to MySQL database using GDAL/OGR ogr2ogr.

This is the command I'm trying:

C:\ms4w\tools\gdal-ogr>ogr2ogr -f MySQL MySQL:banyuwangigis,user=root,password=
-lco GEOMETRY_NAME=layerkecamatan c:\ms4w\apps\banyuwangigis\petadasar\shp\admin
polygon.shp

This is the resulting error:

MySQL driver does not support data source creation.

What have I missed?

Best Answer

According to the OGR MySQL driver doc:

The MySQL driver does not support creation of new datasets (a database within MySQL), but it does allow creation of new layers within an existing database.

So, in your case, you have to create the database banyuwangigis first.

Related Question