mYn*_*EAm 4 authentication postgresql sasl-scram postgresql-10
我编辑了pg_hba.conf:
sudo su postgres
nano /etc/postgresql/10/main/pg_hba.conf
Run Code Online (Sandbox Code Playgroud)
并添加以下行:
local all username scram-sha-256
Run Code Online (Sandbox Code Playgroud)
并且改变了这一切md5,以scram-sha-256在该文件中。
作为postgres用户,我创建了一个具有超级用户权限的新用户:
sudo su postgres
psql
CREATE USER username WITH SUPERUSER PASSWORD 'password';
Run Code Online (Sandbox Code Playgroud)
然后我重新启动了Postgres:
/etc/init.d/postgresql restart
Run Code Online (Sandbox Code Playgroud)
并尝试使用pgAdmin4登录,我在其中更改了数据库的Connection属性下的用户名。但是,无论如何,这都psql -U username testdb < ./testdb.sql不起作用:
严重:用户“用户名”的密码身份验证失败
那么如何在我的Debian9 / KDE机器上让Postgres使用scram-sha-256?早前工作时,我离开了所有md5在pg_hba.conf原样。