Jes*_*ues 6 postgresql ubuntu pgadmin-4
伙计们!我正在尝试在 pdAdmin 4 中创建本地服务器,但每次尝试创建时都会收到此错误:
[pgAdmin 错误]

如果“veterano”是我的用户名......
我尝试运行此操作(但不起作用)
检查 Postgres 服务是否安装正确:
$ sudo systemctl is-active postgresql
终端背面:
active
$ sudo systemctl is-enabled postgresql
终端背面:
enabled
$ sudo systemctl status postgresql
终端背面:
active (exited)
$ sudo pg_isready
终端背面:
/var/run/postgresql:5433 - accepting connections
我对 pg_hba.conf 的配置:
local all postgres peer
# TYPE DATABASE USER ADDRESS METHOD
# "local" is for Unix domain socket connections only
local all all peer
# IPv4 local connections:
host all all 127.0.0.1/32 md5
# IPv6 local connections:
host all all ::1/128 md5
# Allow replication connections from localhost, by a user with the
# replication privilege.
local replication all peer
host replication all 127.0.0.1/32 md5
host replication all ::1/128 md5
Run Code Online (Sandbox Code Playgroud)
(每次更改 pg_hba.conf 中的某些内容后,我都会运行$ sudo systemctl restart postgresql以重新启动 postgress 服务。)
检查 psql 和新的超级用户:
$ sudo -u postgres createuser -s $USER
终端返回,
createuser: error: creation of new role failed: ERROR: role "veterano" already exists
如果我尝试
psql -U veterano我可以登录...所以我尝试\du检查终端返回的角色列表
List of roles
Role name | Attributes | Member of
-------------+------------------------------------------------------------+-----------
postgres | Superuser, Create role, Create DB, Replication, Bypass RLS | {}
veterano | Superuser, Create role, Create DB | {}
Run Code Online (Sandbox Code Playgroud)
所以我尝试在终端中创建一个本地主机服务器:
$ psql -h localhost -d mydatabase -U veterano -p 5432
终端背面:
Password for user veterano:
(我输入的密码是用ALTER USER veterano PASSWORD 'newPassword';)
终端返回错误
psql: error: FATAL: password authentication failed for user "veterano"
我真的不知道该怎么办...我尝试了一切,但仍然无法在 pgAdmin 4 中或直接在终端中创建本地服务器。
使用 Ubuntu 20.04.2 LTS
(对不起我的英语不好 )
Ald*_*ldo 13
这可能已经太晚了。但我对vetero有同样的问题,我所做的就是更改我拥有的帐户“postgres”的密码:(对于那些不知道的人,postgresql安装后默认有一个名为“postgres”的用户)
步骤:访问PSQL
$ sudo su - postgres
Run Code Online (Sandbox Code Playgroud)
然后尝试输入以下命令更改“postgres”用户的密码:
postgres=# \password
Run Code Online (Sandbox Code Playgroud)
然后您可以为此帐户指定任何密码。完成后,您可以使用 pgAdmin 使用“postgres”用户名和您刚刚设置的密码进行连接。
| 归档时间: |
|
| 查看次数: |
44968 次 |
| 最近记录: |