postgresql pgAdmin 4:为什么我不能访问服务器?

3vpjnl9f  于 2023-05-06  发布在  PostgreSQL
关注(0)|答案(3)|浏览(638)

在pgAdmin 4中,当我尝试单击PostgreSQL 14服务器(或任何其他服务器)时,我得到一个我不理解的错误消息:

connection to server at "localhost" (::1), port 5432 failed: could not initiate
GSSAPI security context: The operation or option is not available: Credential
for asked mech-type mech not found in the credential handle connection to
server at "localhost" (::1), port 5432 failed: FATAL: role "postgres" does not
exist

该网站为Postgres应用程序提供了一个安装程序,它提供了

Could not start PostgreSQL server. pg_ctl: Could not start server. Examine the log output.

日志输出为:

2022-07-29 10:41:10.111 EDT [44185] LOG:  starting PostgreSQL 14.4 on aarch64-apple-darwin20.6.0, compiled by Apple clang version 12.0.5 (clang-1205.0.22.9), 64-bit
2022-07-29 10:41:10.113 EDT [44185] LOG:  listening on IPv6 address "::1", port 5432
2022-07-29 10:41:10.113 EDT [44185] LOG:  listening on IPv4 address "127.0.0.1", port 5432
2022-07-29 10:41:10.114 EDT [44185] LOG:  listening on Unix socket "/tmp/.s.PGSQL.5432"
2022-07-29 10:41:10.119 EDT [44186] LOG:  database system was interrupted; last known up at 2022-06-01 12:45:50 EDT
2022-07-29 10:41:10.198 EDT [44186] LOG:  invalid primary checkpoint record
2022-07-29 10:41:10.198 EDT [44186] PANIC:  could not locate a valid checkpoint record
2022-07-29 10:41:10.198 EDT [44185] LOG:  startup process (PID 44186) was terminated by signal 6: Abort trap: 6
2022-07-29 10:41:10.198 EDT [44185] LOG:  aborting startup due to startup process failure
2022-07-29 10:41:10.199 EDT [44185] LOG:  database system is shut down
jpfvwuh4

jpfvwuh41#

我遇到了同样的问题,发现问题是默认的“用户名”时,连接服务器在pgAdmin 4需要更新,以匹配超级用户,是创建时,我已经设置了postgres。在psql中运行'\du'命令以获取数据库角色并确认为超级用户创建的“角色名称”。因此,对于任何其他人是有麻烦的这个同样的问题,我会建议首先尝试这种方法。在:Register - Server下,更新General选项卡〉'Name' = 'localhost',然后更新Connection选项卡〉'Host name' = 'localhost','Username' = 'Match to your Database Role for SuperUser'

neekobn8

neekobn82#

如果您正在运行本地服务器,这可能会有所帮助。我也遇到过类似的问题,通过使用另一个名为postgresapp的客户端应用程序启动我的本地pg服务器来解决它。这里:https://postgresapp.com/
请确保默认端口5432是空闲的;否则选择另一个端口;

1l5u6lss

1l5u6lss3#

已解决:
我删除了数据目录/Users/jonathan/Library/Application Support/Postgres/var-14并重新开始。

相关问题