如何在postgresql中解锁超级用户'postgres'帐户[关闭](How to unlock superuser 'postgres' account

编程入门 行业动态 更新时间:2024-10-25 06:28:41
如何在postgresql中解锁超级用户'postgres'帐户[关闭](How to unlock superuser 'postgres' account in postgresql [closed])

在使用正确的密码连接到pgadmin数据库postgres时,我收到以下错误:

'Error connecting to the server:FATAL password authentication failed with user 'postgres'.

在hba配置文件中将方法更改为'trust'而不是'md5'之后,然后键入:

ALTER USER POSTGRES WITH PASSWORD 'newpassword'

再次将方法更改为md5然后尝试连接到数据库

Howerver密码更改成功(我检查了加密模式,它很好),但得到相同的问题:

'Error connecting to the server:FATAL password authentication failed with user 'postgres'.

如果有任何其他解决方案,请建议我。

While connecting to the pgadmin database postgres with correct password, I'm getting the following error:

'Error connecting to the server:FATAL password authentication failed with user 'postgres'.

After changing the method to 'trust' instead of 'md5' in hba config file, and then typed:

ALTER USER POSTGRES WITH PASSWORD 'newpassword'

after again changing the methods as md5 then tried connecting to database

Howerver the password changed successfully (I checked in encrypt mode and it was fine) but getting the same issue:

'Error connecting to the server:FATAL password authentication failed with user 'postgres'.

Kindly suggest me if there are any other solution for this issue.

最满意答案

这告诉我,你要么是针对外部来源进行身份验证(不常见),要么是某种方式你被pgAdmin中的一个错误所困扰,该错误将有效设置为无效日期(更常见)。

尝试这个:

ALTER USER postgres VALID UNTIL 'infinity';

或者,如果要在特定时间段后锁定帐户,可以将有效直到值设置为更有限的值。

This suggests to me that either you are authenticating against an outside source (not common) or somehow you have been bitten by a bug in pgAdmin that set validto to an invalid date (more common).

Try this:

ALTER USER postgres VALID UNTIL 'infinity';

Or you can set the valid until value to something more limited if you want to lock the account after a certain time period.

更多推荐

本文发布于:2023-07-14 20:44:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1107304.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:解锁   帐户   用户   如何在   postgres

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!