Guest User

Untitled

a guest
Nov 19th, 2017
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. Access Postgres :
  2. sudo -i -u postgres
  3. psql
  4.  
  5. Create New User:
  6. Step 1 :
  7. createuser --interactive <usrer-name>
  8. createdb <database-name>
  9.  
  10. Setp 2 :
  11. postgres@hostname:~$ psql
  12. postgres=# alter user username with encrypted password 'password';
  13. ALTER ROLE
  14. postgres=# grant all privileges on database databasename to username;1
  15. GRANT
  16.  
  17. Setp 3:
  18. Open File /etc/postgresql/9.3/main/pg_hba.conf
  19. Replace "host all all 127.0.0.1/32 trust" to "host all all 0.0.0.0/0 trust"
  20.  
  21. Open File /etc/postgresql/9.3/main/postgresql.conf
  22. uncomment "listen_addresses = '*'"
  23.  
  24. Setp 4:
  25. sudo service postgres restart
Add Comment
Please, Sign In to add comment