sudo apt install postgresql postgresql-contrib
sudo -u postgres psql
select version();
show LC_COLLATE;
ALTER ROLE postgres WITH password 'hogehoge';
/etc/postgresql/14/main/postgresql.conf を編集する。
# - Connection Settings -
#listen_addresses = 'localhost' # what IP address(es) to listen on;
listen_addresses = '*' # what IP address(es) to listen on;
# comma-separated list of addresses;
# defaults to 'localhost'; use '*' for all
# (change requires restart)
port = 5432 # (change requires restart)
/etc/postgresql/14/main/pg_hba.confを編集する。
host all all 192.168.42.0/24 md5
host all all 192.168.1.0/24 md5
sudo systemctl restart postgresql.service
|