shokti

ubuntu 12.04 - postgresql 9.1 installation

Dec 12th, 2012
219
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.42 KB | None | 0 0
  1. edit repository:
  2. sudo nano /etc/apt/sources.list
  3.  
  4. add repo below:
  5. deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main
  6.  
  7. download key:
  8. wget http://apt.postgresql.org/pub/repos/apt/ACCC4CF8.asc
  9.  
  10. install repo key:
  11. sudo apt-key add ACCC4CF8.asc
  12.  
  13. update repo database:
  14. sudo apt-get update
  15.  
  16. install postgresql:
  17. sudo apt-get install postgresql libpq-dev
  18.  
  19. to check if installation successful:
  20. locate postgresql
  21.  
  22. to check installed version:
  23. psql -V
  24.  
  25. change postgresql user password:
  26.  
  27. change to ubuntu postgres user:
  28. sudo su - postgres
  29.  
  30. go to postgres commandline:
  31. psql -d postgres -U postgres
  32.  
  33. while on postgres commandline, change postgres user password with your own password:
  34. alter user postgres with password 'your_password_here';
  35.  
  36. exit postgres commandline:
  37. \q
  38.  
  39. exit postgres user:
  40. exit
  41.  
  42.  
  43. to access postgres from remote:
  44.  
  45. Make changes to pg_hba.conf (authetification methods):
  46. sudo nano /etc/postgresql/9.1/main/pg_hba.conf
  47.  
  48. change md5 to trust, change network address/subnet mask:
  49. host all all 192.168.254.0/24 trust
  50.  
  51. edit postgresql.conf:
  52. sudo nano /etc/postgresql/9.1/main/postgresql.conf
  53.  
  54. change #listen_addresses = 'localhost' to listen_addresses = '*':
  55. listen_addresses = '*'
  56.  
  57. restart postgresql:
  58. sudo /etc/init.d/postgresql restart
  59.  
  60. install postgres administration tool:
  61. sudo apt-get install pgadmin3
Advertisement
Add Comment
Please, Sign In to add comment