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?

1 Answer 1


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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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