User Tools

Site Tools


dev:postgres

Differences

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

Link to this comparison view

Next revision
Previous revision
dev:postgres [2023/02/14 06:07] – created - external edit 127.0.0.1dev: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:  
 +  find / -name "postgresql.conf" 
 + 
 +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.1676354858.txt.gz · Last modified: 2023/02/14 06:07 by 127.0.0.1