Dear all,<br>I am starting with mapserver and now I have problems with database issues.<br>I am using Mysql 5 in windows XP. Mapserver was installed with ms4w 2.2.5. Normally Mapserver is working fine.<br>I tried to draw a layer from a mySQL table. The table has spatial information, 
i.e. x/y columns.<br>I tried in two ways first with .ovf file and then with direct ogr connection. I was unsuccessful in both case.<br><br>1) .ovf<br><span style="font-weight: bold; text-decoration: underline;">MAP FILE for the layer
<br><br></span>&nbsp;&nbsp;&nbsp; LAYER &nbsp;&nbsp; &nbsp;# point layer with sampled site starts here, query and join<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;NAME &quot;dbsites&quot;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; TYPE point<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;CONNECTIONTYPE OGR&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;CONNECTION &quot;
mysql.ovf&quot;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;DATA &quot;aquidata&quot;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;TRANSPARENCY 100<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;STATUS on<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;HEADER &quot;c:/ms4w/tmp/ms_tmp/appl/q_templates/gru_CGI_db_header.html&quot;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;FOOTER &quot;c:/ms4w/tmp/ms_tmp/appl/q_templates/gru_CGI_db_footer.html&quot;
<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;TEMPLATE &quot;c:/ms4w/tmp/ms_tmp/appl/q_templates/gru_CGI_db_class_query.html&quot;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;TOLERANCE 150<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;TOLERANCEUNITS pixels<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;CLASS&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;NAME &quot;dbsites&quot;
<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;STYLE<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;SYMBOL &#39;circle&#39;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;COLOR 0 0 0<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;SIZE 7<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;END # end style<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;END # end class<br>&nbsp;&nbsp;&nbsp; END &nbsp;&nbsp; &nbsp;# sites layer ends here 
<br><br><span style="text-decoration: underline;">.ovf file<br><br></span>&lt;OGRVRTDataSource&gt;<br>&nbsp;&nbsp;&nbsp; &lt;OGRVRTLayer name=&quot;aqidata&quot;&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;SrcDataSource&gt;MYSQL:URBSISdtb_GRU01,user=root,password=leo,host=localhost,port=3306,tables=qloc&lt;/SrcDataSource&gt; 
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;SrcSQL&gt;SELECT LocCode, X, Y, alt, lu, relief FROM qloc&lt;/SrcSQL&gt; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;GeometryType&gt;wkbPoint&lt;/GeometryType&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;GeometryField encoding=&quot;PointFromColumns&quot; x=&quot;X&quot; y=&quot;Y&quot;/&gt; 
<br>&nbsp;&nbsp;&nbsp; &lt;/OGRVRTLayer&gt;<br>&lt;/OGRVRTDataSource&gt;<br><br>The ovf file was tested in ogrinfo and everything was fine. When used in the html template wih CGI substitution strings the following error was reported<br>
<br>
msDrawMap(): Image handling error. Failed to draw layer named &#39;dbsites&#39;. <br>
msOGRFileOpen(): OGR error. GetLayer(aquidata) failed for OGR connection `mysql.ovf&#39;. <br><br><br>2) direct OGR<br>&nbsp;&nbsp;&nbsp; LAYER &nbsp;&nbsp;&nbsp; # point layer with sampled site starts here, query and join<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; NAME &quot;dbsites&quot;
<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; TYPE point<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; CONNECTIONTYPE OGR&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; CONNECTION &quot;MYSQL:URBSISdtb_GRU01,user=root,password=leo,host=localhost,port=3306,tables=qloc&quot;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; DATA &quot;SELECT LocCode, X, Y, alt, lu, relief FROM qloc&quot;
<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; TRANSPARENCY 100<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; STATUS on<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; HEADER &quot;c:/ms4w/tmp/ms_tmp/appl/q_templates/gru_CGI_db_header.html&quot;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; FOOTER &quot;c:/ms4w/tmp/ms_tmp/appl/q_templates/gru_CGI_db_footer.html&quot;
<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; TEMPLATE &quot;c:/ms4w/tmp/ms_tmp/appl/q_templates/gru_CGI_db_class_query.html&quot;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; TOLERANCE 150<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; TOLERANCEUNITS pixels<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; CLASS&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; NAME &quot;dbsites&quot;
<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; STYLE<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; SYMBOL &#39;circle&#39;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; COLOR 0 0 0<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; SIZE 7<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; END # end style<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; END # end class<br>&nbsp;&nbsp;&nbsp; END &nbsp;&nbsp;&nbsp; # sites layer ends here
<br><br>In this case the layer is displayed in the legend, but not draw and no query are possible.<br><br>If someone has any hints on how to solve that.<br><br>Thank you very much in advance<br><br>Laura<br><span style="text-decoration: underline;">
</span>