Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

pgAdmin 4: Why Can't I Access Server?

In pgAdmin 4, when I try click on the PostgreSQL 14 server (or any other) I get an error message that I don't understand:

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

The web site yields an installer for the Postgres app, which gives

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

The log output is:

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
like image 816
Jonathan Levi Avatar asked Feb 10 '26 23:02

Jonathan Levi


1 Answers

I was experiencing the same issue and found the issue was the default "Username" when connecting the server in pgAdmin 4 needed to be updated to match the Superuser that was created when I had set up postgres. Run '\du' command in psql to get the Database Roles and confirm the "Role name" that was created for the Superuser. So for anyone else that is having trouble with this same issue I would recommend first trying this approach. under: Register - Server, update General tab > 'Name' = 'localhost', then update Connection tab > 'Host name' = 'localhost' , 'Username' = 'Match to your Database Role for SuperUser'

like image 130
mcoreycoder Avatar answered Feb 13 '26 19:02

mcoreycoder