2

I have 50 line objects in .shp format in folder on my computer. I need to insert it to postgis database on the distant server.. When I log in in phpPgAdmin, it says it runs on localhost:5433. What is the quick way to insert my .shp data into database?

asked Jun 9, 2011 at 15:50

3 Answers 3

4

You can run shp2pgsql to convert the shapefile into SQL. You should be able to execute the resulting SQL file in phpPgAdmin.

QGIS offers a GUI for shp2pgsql via "Postgis Manager" plugin. You can connect to the remote database and load shapefiles directly without the need for phpPgAdmin.

answered Jun 9, 2011 at 16:06
4
  • I don't understand where to find Postgis Manager plugin? Commented Jun 9, 2011 at 16:21
  • I found it, I'll try it now. Commented Jun 9, 2011 at 16:28
  • I can't connect to my database. Commented Jun 9, 2011 at 16:37
  • 1
    Note: Postgres has to be configured to listen to external IPs. This is not enabled by default Commented Jun 9, 2011 at 16:49
3

On windows PgAdmin III is under Start->Programs->PostgreSQL 8.4->PgAdmin III Login with the super user usually postgres and the password you chose during install. If you forgot it, then go into pg_hba.conf (just open it with an editor such as notepad or a programmer editor). Set the line

host all all 127.0.0.1/5433 md5
to
host all all 127.0.0.1/5433 trust

if you trust it use

host all all localhost/5433 trust (host all all 0.0.0.0/0 md5 will give all users access)
answered Jun 9, 2011 at 21:05
3

Another way to do this is to use SSH tunnels - use putty (or other SSH client) to log in to the remote machine and set a tunnel from localhost:5433 to remotemachine:5433. See http://howto.ccs.neu.edu/howto/windows/ssh-port-tunneling-with-putty/ for more details. Then you can run PGAdmin on your local machine and it will talk directly to the remote machine.

answered Jun 9, 2011 at 16:22
2
  • I can't connect to database. I tried with putty but it doesn't work. Commented Jun 9, 2011 at 16:36
  • if you log into the remote machine can you access the DB? Commented Jun 9, 2011 at 19:30

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.