This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | |||
сервис_postgresql [2025/04/07 14:56] val [psql] |
сервис_postgresql [2025/04/07 16:12] (current) val [psql] |
||
---|---|---|---|
Line 20: | Line 20: | ||
blogs=# \d table_name | blogs=# \d table_name | ||
+ | |||
+ | postgres=# ALTER USER postgres WITH PASSWORD 'strongpassword'; | ||
</code> | </code> | ||
+ | |||
+ | ===== Подключение по сети ===== | ||
+ | <code> | ||
+ | # diff postgresql.conf /etc/postgresql/15/main/postgresql.conf | ||
+ | 59a60 | ||
+ | > listen_addresses = '*' | ||
+ | |||
+ | # diff pg_hba.conf /etc/postgresql/15/main/pg_hba.conf | ||
+ | 97c97,98 | ||
+ | < host all all 127.0.0.1/32 scram-sha-256 | ||
+ | --- | ||
+ | > #host all all 127.0.0.1/32 scram-sha-256 | ||
+ | > host all all 0.0.0.0/0 scram-sha-256 | ||
+ | |||
+ | # systemctl restart postgresql | ||
+ | |||
+ | $ psql postgres://postgres:strongpassword@IP_OR_DNS_NAME:5432/postgres | ||
+ | </code> | ||
+ | |||
+ |