我使用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.