0

I installed postgresql server on Linux Mint, however, all I get from it is

"FATAL: role "username" does not exist".

I've tried the following commands (probably some more):

psql
psql --list
psql \du
psql \l
psql -d template1
createuser -s -r postgres

Same thing happens if I switch the user to postgres:

su - postgres

The postgresql version is 9.3.

What's the correct approach on solving this? Thanks.

Vao Tsun
  • 47,234
  • 13
  • 100
  • 132
Deez
  • 849
  • 2
  • 9
  • 28
  • I've written a [blog](http://zedfox.us/blog/install-postsgresql-9-6-on-ubuntu-16-04-xenial-and-reset-postgres-password/) recently regarding this. I hope a couple of strategies help you. Try editing /etc/postgresql/9.3/main/pg_hba.conf and changing the last bit of this line`local all postgres peer`. Change from `peer` to `trust`. Restart postgres and see if you can log on with `psql -U postgres` – zedfoxus Dec 05 '16 at 20:35

1 Answers1

0

By default a database user postgres is created on installation. You should be able to connect without password as system user postgres.

Peer authentication must be enabled, of course:

Community
  • 1
  • 1
Erwin Brandstetter
  • 605,456
  • 145
  • 1,078
  • 1,228