The following article describes how to import a shp file to a MySQL database. Some time ago, a friend asked me about the actual operation process of importing a shp file to a MySQL database, in fact, it is very simple as long as you have figured out the steps, so today we will share this solution with you.
A shp file consists of multiple files
Import the shp file to the MySQL database and use the shp2MySQL doc command.
First download DOShere
/Files/ycsfwhh/import the SHP file to mysqlcommand. rar
1. Put shp and shp related files and DOShere doc files in the same directory.
2. The doc command is:
Shp2MySQL shp file name. shp table name Database Name> generated SQL file name. SQL
3. Modify the generated SQL file:
- Alter table name ADD the_geom GEOMETRY;
Add must be the_geom GEOMETRY
Replace all,-1 ));
4. Import the SQL file to the MySQL database.
5. Connect MySQL Data in geoserver to display the map
The above content introduces the actual operation steps for importing the shp file to the MySQL database.