User Tools

Site Tools


dev:postgres

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
dev:postgres [2024/12/08 05:42] adamdev:postgres [2024/12/08 21:30] (current) adam
Line 1: Line 1:
 create user, and then database for that user. create user, and then database for that user.
  
-    sudo -u postgres psql +  sudo -u postgres psql 
-    postgres=# create database mydb; +  postgres=# create database mydb; 
-    postgres=# create user myuser with encrypted password 'mypass'; +  postgres=# create user myuser with encrypted password 'mypass'; 
-    postgres=# grant all privileges on database mydb to myuser;+  postgres=# grant all privileges on database mydb to myuser; 
 +   
 + 
 +https://stackoverflow.com/a/75876944/1173856
  
 to enable logins from external systems:  to enable logins from external systems: 
Line 10: Line 13:
  
 find in there ''listen_addresses = 'localhost''', change to ''listen_addresses = '*''' find in there ''listen_addresses = 'localhost''', change to ''listen_addresses = '*'''
 +
 +pga_hba.conf is probably right next to it. add these:
 +
 +  host    all             all              0.0.0.0/                      md5
 +  host    all             all              ::/0                            md5
 +
 +
dev/postgres.1733636542.txt.gz · Last modified: 2024/12/08 05:42 by adam