Advertisement
Guest User

Untitled

a guest
Jul 25th, 2014
236
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.31 KB | None | 0 0
  1. psql: FATAL: Ident authentication failed for user "postgres"
  2.  
  3. $ sudo -u postgres psql
  4. password
  5. Enter password: ...
  6. ...
  7.  
  8. $ psql -U postgres -h localhost
  9.  
  10. /etc/init.d/postgresql reload
  11.  
  12. sudo apt-get install pidentd
  13. sudo service postgresql restart
  14.  
  15. # in bash_profile edit PGDATA environmental variable
  16. open ~/.bash_profile
  17.  
  18. # append this line to bash_profile
  19. export PGDATA="/Library/PostgreSQL/9.3/data"
  20.  
  21. # reload bash_profile
  22. source ~/.bash_profile
  23.  
  24. # open pg_hba.conf in vim
  25. sudo vi /Library/PostgreSQL/9.3/data/pg_hba.conf
  26.  
  27. # append these two lines to the end of the pg_hba.conf file
  28. local all all trust
  29. host all all 127.0.0.1/32 trust
  30.  
  31. # can now login as user in bash
  32. psql -d <db_name> -U <user_name> -W
  33.  
  34. host all all ::1/128 password
  35.  
  36. $ psql -U db_user db_name
  37. psql: FATAL: Peer authentication failed for user "db_user"
  38.  
  39. $ export PGHOST=localhost
  40. $ psql -U db_user db_name
  41.  
  42. Password for user mfonline:
  43.  
  44. development:
  45. adapter: postgresql
  46. encoding: unicode
  47. database: (appname)_development
  48. pool: 5
  49. username: (username you granted appname database priviledges to)
  50. password:
  51.  
  52. local all postgres peer
  53. Should be
  54.  
  55. local all postgres md5
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement