postgres ユーザのパスワードを変えて認証復活[PostgreSQL]
(2026-07-23 07:08:07) by shinoda


< ページ移動: 1 2 >

trust 認証のままというのもよくないだろうから、postgres ユーザのパスワードを変更して scram-sha-256 認証に戻すことにする。

まず、postgres ユーザのパスワードを 'grespost' に変更(SQL Shell (psql) で接続し作業)

postgres=# ALTER ROLE postgres WITH PASSWORD 'grespost';
ALTER ROLE

次に、設定ファイルを編集。
(例)C:\Program Files\PostgreSQL\13\data\pg_hba.conf

# TYPE  DATABASE        USER            ADDRESS                 METHOD

# "local" is for Unix domain socket connections only
local   all             all                                     scram-sha-256
# IPv4 local connections:
host    all             all             127.0.0.1/32            scram-sha-256
# IPv6 local connections:
host    all             all             ::1/128                 scram-sha-256
# Allow replication connections from localhost, by a user with the
# replication privilege.
local   replication     all                                     scram-sha-256
host    replication     all             127.0.0.1/32            scram-sha-256
host    replication     all             ::1/128                 scram-sha-256

< ページ移動: 1 2 >


コメント投稿
次の記事へ >
< 前の記事へ
TOPへ戻る

Powered by
MT4i 3.0.8