Postgres - Install and Create databases and users for Fedora 14


/ Published in: Bash
Save to your folder(s)



Copy this code and paste it in your HTML
  1. #Fedora
  2. % sudo rpm -Uvh http://yum.pgrpms.org/reporpms/8.4/pgdg-fedora-8.4-2.noarch.rpm
  3.  
  4. % sudo yum install postgresql postgresql-server postgresql-contrib
  5.  
  6. #Initialize
  7. % service postgresql initdb
  8.  
  9. # Edit conf adding permited addresses and port
  10. % nano -w /var/lib/pgsql/data/postgresql.conf
  11.  
  12. # listen_addresses = '*'
  13. # port = 5432
  14.  
  15. # Edit damned pg_hba.conf and allow login for no encryption for local and network connections
  16.  
  17. # "local" is for Unix domain socket connections only
  18. local all all password
  19. #IPv4 local connections:
  20. host all all 127.0.0.1/32 password
  21.  
  22. # Start postgres
  23.  
  24. % service postgresql start
  25.  
  26. # Create database
  27. % su postgres
  28. % createdb test
  29.  
  30. # Login on database
  31. % psql test
  32.  
  33. # Create new role with grants to database
  34. test=#
  35.  
  36. # Create new superuser to connect to test database
  37. test=# CREATE ROLE testuser WITH SUPERUSER LOGIN PASSWORD 'test';

URL: http://www.if-not-true-then-false.com/2010/howto-install-postgresql-8-4-database-server-on-centos-fedora-red-hat/

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.