Advertisement
asanchez75

Linux/Debian/Postgres

Jun 18th, 2011
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.76 KB | None | 0 0
  1. After you have installed you postgres and pgadmin3, follow these steps
  2.  
  3. reset the password for the ‘postgres’ admin account for the server
  4.  
  5. sudo su postgres -c psql template1
  6. template1=# ALTER USER postgres WITH PASSWORD ‘password’;
  7. template1=# \q
  8.  
  9. That alters the password for within the database, now we need to do the same for the unix user ‘postgres’:
  10.  
  11. sudo passwd -d postgres
  12.  
  13. sudo su postgres -c passwd
  14.  
  15. Now enter the same password that you used previously.
  16.  
  17. 2. /etc/postgresql/8.2/main/postgresql.conf
  18.  
  19. Now, to edit a couple of lines in the ‘Connections and Authentication’ section
  20.  
  21. listen_addresses = ‘*’
  22. password_encryption = on
  23.  
  24. 3. /etc/postgresql/8.4/main/pg_hba.conf
  25.  
  26. # DO NOT DISABLE!
  27. # If you change this first entry you will need to make sure that the
  28. # database
  29. # super user can access the database using some other method.
  30. # Noninteractive
  31. # access to all databases is required during automatic maintenance
  32. # (custom daily cronjobs, replication, and similar tasks).
  33. #
  34. # Database administrative login by UNIX sockets
  35. local all postgres ident
  36.  
  37. # TYPE DATABASE USER CIDR-ADDRESS METHOD
  38.  
  39. # "local" is for Unix domain socket connections only
  40. local all all ident
  41. # IPv4 local connections:
  42. #host all all 127.0.0.1/32 md5
  43. host all all 127.0.0.1 255.255.255.255 trust
  44. # IPv6 local connections:
  45. host all all ::1/128 md5
  46.  
  47. ===========================================================
  48.  
  49. Taken from
  50.  
  51. http://www.ubuntugeek.com/howto-setup-database-server-with-postgresql-and-pgadmin3.html
  52.  
  53. http://www.forosdelweb.com/f99/conectar-postgresql-con-pgadmin3-424533/
  54.  
  55.  
  56. =======================================================
  57. Instalación de Postgis
  58. =======================================================
  59.  
  60. If you have installed postgres and postgis from apt, so you can follow up these steps
  61.  
  62. sudo -u postgres createdb geo_db
  63. sudo -u postgres createlang plpgsql geo_db
  64. sudo -u postgres psql -d geo_db -f /usr/share/postgresql/8.4/contrib/postgis-1.5/postgis.sql
  65. sudo -u postgres psql -d geo_db -f /usr/share/postgresql/8.4/contrib/postgis-1.5/spatial_ref_sys.sql
  66. sudo -u postgres psql -d geo_db -f /usr/share/postgresql/8.4/contrib/postgis_comments.sql
  67.  
  68.  
  69. ================================================================
  70.  
  71. Taken from
  72.  
  73. http://kjoller.eu/blog/en/2011/03/25/installation-af-postgis-pa-debian-60/
  74.  
  75. ========================================================
  76.  
  77. comandos sql for postgis
  78.  
  79. =======================================================
  80.  
  81.  
  82. Select ST_AsEWKT(the_geom) from "Huanuco" LIMIT 5;
  83.  
  84.  
  85. Select ST_AsText(the_geom) from "Huanuco" LIMIT 5;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement