English 中文(简体)
pg Admin 4 - 试图与PogreSQL 13服务器连接的“邮政”用户密码
原标题:pg Admin 4 - password for "postgres" user when trying to connect to PostgreSQL 13 server

我知道,这个问题已经多次问过,但我没有找到解决这一问题的办法!

I downloaded PostgreSQL 13 with pg Admin 4 and when I open it for the first time after installation it asks me for the master password that I was asked to set during installation, after I give the master password and this gets accepted I try to connect to the default server created during the installation: "PostgreSQL 13".

此时此刻,它请我给我一个我不知道什么地方的用户“邮政”密码。 具体地说,请进入用户站连接服务器的密码——“PostgreSQL 13”。

我已经尝试了我设法在互联网上发现的所有“过失”密码,但错误总是一样:

FATAL: 用户“海报”的密码认证失败

我也试图不添加任何带有错误的密码:

fe_sendauth:无密码供应

I don t know what to do. In PostgreSQL 13 the authentication method is encrypted via scram-sha-256. I already tried to set the method to trust, restart the mac, and open pg Admin 4 that keeps asking me for the password to access the server.

我也尝试使用指挥线工具,但最终会遇到同样的错误。

最后,这正是我的<代码>pg_hba.conf。 looks:

# 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

PS. I ve also tried to uninstall PostgreSQL 13, deleting the postgres user and re-download and re-install everything... nothing changed.


如果有人能够帮助我成为我的行凶者,我会事先感谢!

最佳回答

我最近也遇到了同样的问题。 以下解决办法对我有利。 我是使用Windows btw的,因此,你应在贵处尝试同等指挥。

  1. Change METHOD of all rows in your pg_hba.conf file from scram-sha-256 to trust
  2. Add bin folder of Postgres installation to path, if you haven t
  3. Open command prompt and enter psql -U postgres. You won t be asked for password here.
  4. Enter password postgres
  5. Choose and confirm your password
  6. Revert pg_hba.conf to original state

现在,你应当能够进入在pgAdmin的“条形”的通过口。

问题回答

Just for reference: I ran into the same issue on ubuntu-20.04 running postgresql-13.1. To solve it with this configuration I had to run the following commands in the terminal:

  1. sudo su postgres
  2. psql
  3. password postgres
  4. enter your password twice

之后,我可以像往常一样通过pgAdmin4,提供固定密码。

** 密码的密码。

  1. If you doing this first time, delete all the existing folders of PostgreSQL in program files and program files x64. Then run the installation again, it worked. Asking for new password.

  2. 如果你记得主言。 缺省用户名称为:)。

为我工作的方法(Windows 10 x64, PostgreSQL 13):

  1. Edit C:Program FilesPostgreSQL13datapg_hba.conf and set "METHOD" column values to trust (security breach, only for testing purposes)
  2. Open Powershell as admin, go to C:Program FilesPostgreSQL13in
  3. Type pg_ctl reload, press Enter.
  4. Launch pgAdmin again

简言之,你开始使用密码(用户/行政密码)。

The following worked for me. Change METHOD of all rows in your pg_hba.conf file from scram-sha-256 to trust (C:Program FilesPostgreSQL14datapg_hba.conf). This will disable password for your DB. Click on any database in postgresql to use Query Tool.

In Query Tool type ALTER USER postgres WITH PASSWORD User_password ; postgres is default username, execute it. This way you can set up a password for your DB, after that go back to the first step and change it back from trust to scram-sha-256.

在我的个案中,我以错误方式在CentOS 8上安装了PogreSQL 10和13台,因此,我停在PogreSQL,并根据邮政总局网站的指示安装了PogreSQL13台,没有其他网站。

How to unistall PostgreSQL

• 如何安装正确的邮局

在我修改了密码后,终端用户/用户(pgAdmin 4网位用户/网位是分散的和分散的服务):

# sudo -i -u postgres
[postgres@server ~$] psql
postgres=# ALTER USER postgres PASSWORD  postgres ;
ALTER ROLE
postgres=# /q
[postgres@server ~$] exit
# sudo systemctl restart postgresql-13

开创一个容易的步骤。

  1. Change METHOD of # IPv4 local connections row in your pg_hba.conf file from scram-sha-256 to trust.
  2. Change the Host name/address in Connection tab to "127.0.0.1" of the Server-PostgreSQL 13(14).
  3. Connect to Server-PostgreSQL 13(14) and input empty string.

现在,您应当能够与用户名登录postgres,并为您的具体数据库创建.

sudo -i -u postgres

psql
ALTER USER postgres PASSWORD  new_password ;
q
exit

确实存在同样的错误。 我认为,问题是错误的口号,我对此作了改动,但认为这个问题更为简单。 服务器刚开工: 因此,我通过独角开始服务器,能够连接。

在安装时,是否安装了密码?

如果没有,使用Windows Add或Remove Programs,停止使用PostgreSQL,删除C下的所有材料:Program 文件,PostgreSQL和再安装。 此时此刻,应促使您提出用户职位密码,并在pgAdmin4中使用相同的密码。

Edit the pg_hba.conf located in the data folder. At the bottom, where it starts: local all all scram-sha-256 change all instances of "scram-sha-256" to "trust", like... local all all trust Save the file and you should be able to get right in.

在安装Pgadmin4后,我也存在同样的问题,因为我能够使用主密码,但邮政密码未被接受。 在花了几个小时时间,试图把格雷斯克勒和平方列,以确认邮政密码后,我最后删除/搬走了Pgadmin4中确定的服务器,并创建了一个新服务器,其名称与原样。 员额b立即得到承认。 我设立了其他支部、指定用户和离职。 当我重新开张时,总密码和职位都被接受,我能够完成我的工作。 这种希望有时会帮助他人,并加重处罚。

在计算机重新启动之后,我也发生了这种情况。 邮政管理处没有运行,我不得不人工pin。 我在这样做之后就不得不打进(没有密码)。

The answer by @dlam works. But the problem remains same. It doesn t accept password when I use psql I found a workaround by using psql -U postgres instead of psql. Or using SQL Shell(psql) also works That works fine. enter image description here

欢迎任何更好的解决办法!

1-change the port number 2-click to postgreSQL13 3-go to connection and change port for 5432

i 只是写的——“密码”并奏效。 In PostgreSql 15

The method that worked for me (Windows 10 x64, PostgreSQL 16):

检查服务运行情况。

  1. Type Service in window search box
  2. Locate the Postgresql-x64-16. Take note of your bit and postgres version
  3. Click the play button at the top to start the server if it is not started
  4. Relaunch pgAdmin 4

我遇到同样的情况。 在我的案件中,我打开了邮政,阻止服务器运行。 然后,我修改了密码,在服务器环境中进行调用,然后从服务器开始。 现在,我能够进入我的新口号,以图格阿明语行得奖。

每当我成立时,我都会这样做。

  1. - 员额 - i

之后,两度进入你的密码。

然后在pgAdmin4中使用这一密码。





相关问题
摘录数据

我如何将Excel板的数据输入我的Django应用? I m将PosgreSQL数据库作为数据库。

Postgres dump of only parts of tables for a dev snapshot

On production our database is a few hundred gigabytes in size. For development and testing, we need to create snapshots of this database that are functionally equivalent, but which are only 10 or 20 ...

How to join attributes in sql select statement?

I want to join few attributes in select statement as one for example select id, (name + + surname + + age) as info from users this doesn t work, how to do it? I m using postgreSQL.

What text encoding to use?

I need to setup my PostgreSQL DB s text encoding to handle non-American English characters that you d find showing up in languages such as German, Spanish, and French. What character encoding should ...

SQL LIKE condition to check for integer?

I am using a set of SQL LIKE conditions to go through the alphabet and list all items beginning with the appropriate letter, e.g. to get all books where the title starts with the letter "A": SELECT * ...

热门标签