FATAL: role 'postgres' does not exist

I've been dockerizing an app with postgresql and making it ready for production. However, when going back to work to a different app (that also is using PostgreSQL), I'm not able to run the django server, neither to access to PostgreSQL 14 server inside of Pgadmin.

When trying to initializate the server in the Pgadmin, there is this message error when entering the password:

connection to server at "localhost" (::1), port 5432 failed: could not initiate GSSAPI security context: The operation or option i s 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

I was using this database normally and without problems, both from Django local development server as well as from Pgadmin. Django project database's user is a different user, but also says role 'username' does not exist.

I tried to follow other answers but can't make it work. How could I have messed it up?

When trying to execute psql -l I get error like:

psql: error: connection to server on socket "/tmp/.s.PGSQL.5432" failed: FATAL:  role "postgres" does not exist
Back to Top