Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I need to connect to a MySql table, which has all the attribute values and the lat & long. I am using a GeoServer Suite to host my raster and so felt the best way to go about it would be to add the MySQL to my Geoserver, but it seems, geoserver comes with Postgres by default.

Is there any My SQL extension to geoserver?

Is this the best approach to obtain the info from a MySql database?

UPDATE: Ok so what I am trying to do is eventually migrate my Database to PostGIS. So I am trying to create a shapefile from MySQL database. The database has non-spatial data with the lat and long associated with each attribute data. I found pyshp, but i think that is reading the shape file. Can we create shapefile using the pyshp (meaning can we create shapefile from MySQL database using pyshp)? Becoz if i am able to create the shapefile then I can easily insert it into PostGIS using geoServer and it can be used in other softwares as well.

share|improve this question
I know that your raster is hosted using GeoServer, but what format is it stored in? For example if the raster is in a database also, then it might be easier to create a query joining the raster and your MySQL tables together first, and then using GeoServer to host the results of that query, rather than trying to do this join after the fact. –  Get Spatial May 5 '12 at 0:15
Yes the raster is in GeoTIFF format. I wish to do what u r saying but how can I join the raster to a MySQL table, since the info in the raster is being extracted using the struct function. How can I find out or access the attribute table of raster? –  Sam007 May 5 '12 at 18:23
add comment

1 Answer

up vote 2 down vote accepted

first of all pls. make acception for accept rate. :)

You can connect mysql to geoserver from Create New Feature Data Set

1.Select New from Config -> Data -> DataStores and define your Feature Data Set Description to MySQL and your feature dataset

2.On feature data set editor, write your database name, user and password with host and port. alternatively you can define maximum and minumum connections.

3.And the last think is submitting and saving your options.

it will come soon is that defining FeatureType. i want to write everything here about connection between geoserver and mysql but i have checked there is good information on opengeo which is very good that you can read on Adding a MySQL Table to GeoServer tutorial...

i hope it helps you...

share|improve this answer
ok when I said connect to MySql table, it is a table with attributes. It is not a spatial data. I think the tutorial is if i wish to connect to a spatial data. Will it work for non-spatial content? –  Sam007 May 4 '12 at 18:06
There is a ticket here "it is for arcsde" Allow serving non-Spatial data. Pls try patches, if not you can open a ticket for your error –  Aragon May 4 '12 at 19:21
how do I install the patch? –  Sam007 May 4 '12 at 23:01
add comment

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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