[mapserver-users] MySQL connection: so near, yet so far...
Stephan Holl
stephan.holl at intevation.de
Wed Jun 22 04:55:52 PDT 2011
Hello Chris,
"Chris Green" <chris.green at ibstv.co.uk>, [20110622 - 12:17:35]
> I am trying to establish a MySQL connection to a Mapserver 6.0 layer
> using OGR. After much trial and error (mostly error) I have got to
> the point where I have an ovf file which I can test using ogrinfo,
> but which I cannot make work in a layer.
>
> My ovf file (OGR_test.ovf) is
>
> <OGRVRTDataSource>
> <OGRVRTLayer name="OGR_test">
>
> <SrcDataSource>mysql:testDB,user=root,password=mysql,port=3306,tables=testTa
> ble</SrcDataSource>
> <SrcSQL>SELECT City, Latitude, Longitude FROM
> testTable</SrcSQL> <GeometryType>wkbPoint</GeometryType>
> <GeometryField encoding="PointFromColumns" x="Longitude"
> y="Latitude"/>
> </OGRVRTLayer>
> </OGRVRTDataSource>
>
> I can successfully test this and see the data in testTable via:
>
> ~# ogrinfo var/www/vhosts/mysite/httpdocs/data/OGR_test.ovf
>
>
> However when I create a test layer I cannot establish the OGR
> connection. I am trying with:
>
> LAYER
> NAME "testLayer"
> STATUS DEFAULT
> TYPE POINT
> CONNECTIONTYPE OGR
> CONNECTION "OGR_test.ovf"
> DATA "OGR_test"
> CLASS
> NAME "MyClass"
> STYLE
> SYMBOL 'circle'
> SIZE 15
> COLOR 0 255 0
> END
> END
> END
>
> This produces an "internal server error".
>
> I have also tried using an absolute path to OGR_test.ovf, still no
> success. It seems that I have not got the CONNECTION and DATA
> parameters right but after reading the MySQL and the OGR sections in
> the Mapserver documentation many times I still can't figure out what
> I'm doing wrong.
>
> Can someone help?
Just a guess.
Make sure you have the exact same env-vars set for apache as you have
set within the shell your ogrinfo-command works. Sometimes there
can be a differnces there?
Best
Stephan
--
Stephan Holl <stephan.holl at intevation.de> | Tel.: +49 (0)541-33 508 3663
Intevation GmbH, Neuer Graben 17, 49074 OS | AG Osnabrück - HR B 18998
Geschäftsführer: Frank Koormann, Bernhard Reiter, Dr. Jan-Oliver Wagner
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20110622/fef3a69d/attachment.sig>
More information about the MapServer-users
mailing list