[FWTools] ogr2ogr with MySQL

Frances Collier fcollier at preparedresponse.com
Fri Oct 13 11:53:58 EDT 2006

That was the problem. Thank you so much for your help!

-----Original Message-----
From: fwtools-bounces at lists.maptools.org
[mailto:fwtools-bounces at lists.maptools.org] On Behalf Of Mateusz Loskot
Sent: Friday, October 13, 2006 6:03 AM
To: fwtools at lists.maptools.org
Subject: Re: [FWTools] ogr2ogr with MySQL

Mateusz Loskot wrote:
>> However, I'm curious why OGR from FWTools does not work for you.
>> If I won't forget, during the weekend, I'll try to test FWTools on
>> my Windows XP machine.


I think I've found where is the problem.
For MySQL, you need to specify -update option for ogr2ogr.
It instructs OGR to open existing data store in update mode,
instead of creating new data store.
The -update option is required on both platforms, Linux and Windows.

So, correct command example should look like this:

1. Create 'world' database

2. Import world_borders.shp layer

C:\data\world>ogr2ogr -f MySQL MySQL:world,user=mloskot -nln borders
world_borders.shp -lco SPATIAL_INDEX=NO -update

I tested it with success on MySQL 5.0.22 on Linux
and 5.0.24 on Windows XP.

Best regards
Mateusz Loskot
FWTools mailing list
FWTools at lists.maptools.org

More information about the FWTools mailing list