小编use*_*957的帖子

使用md5加密密码而不是明文密码登录PostgreSQL

我使用md5加密密码创建了一个用户,如下所示:

create user testuser with encrypted password 'md54ca03099a7cd3945e0260801ff5972a3';
Run Code Online (Sandbox Code Playgroud)

加密密码是md5 +密码+用户名的组合

password=test
username=testuser
Run Code Online (Sandbox Code Playgroud)

使用md5方法在pg_hba.conf文件中添加了testuser条目

现在我尝试使用上面创建的用户登录,如下所示:

psql -d dbexpress -U testuser
Run Code Online (Sandbox Code Playgroud)

它会提示输入密码.我提供了以上加密密码,因此它给出了我的错误:

psql: FATAL:  password authentication failed for user "testuser"
Run Code Online (Sandbox Code Playgroud)

但是我可以使用plaintest密码"test"登录postgresql.

authentication passwords postgresql md5 psql

7
推荐指数
1
解决办法
1万
查看次数

标签 统计

authentication ×1

md5 ×1

passwords ×1

postgresql ×1

psql ×1