[FWTools] Problem:MIF TO MYSQL

Frank Warmerdam warmerdam at pobox.com
Tue Jun 22 10:37:34 EST 2010


ShiSara wrote:
> 
> Hi everyone,
> I met a problem when using ogr2ogr to convert mif files to mysql.
> The comand used:
> ogr2ogr -f "MySQL" MySQL: "dbname=test host=localhost port=3306 
> user=root password=123" d:\test.mif
>  
> The error message:
>  
> ERROR 1: MySQL connect failed for: dbname=test host=localhost port=3306 
> user=root passw
> ord=123
> Unknown database 'dbname=test  host=localhost port=3306 user=root 
> password=123'

Sarah,

I believe you are formatting the connection string a bit wrong.
I think it should be more like:

MYSQL:test,user=root,password=123,host=localhost,port=3306

You have used a form like the postgres/postgis connection string
but Mysql is slightly different as specified at:

  http://www.gdal.org/ogr/drv_mysql.html

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent



More information about the FWTools mailing list