0

I am trying to create a new user. I am getting same error consistently. I tried lot of solutions given online but no luck.

I am using

Postgres 9.5
Ubuntu 16.04
my username ravi

I am trying by this command

createuser -e -E sonar -s -U "$(whoami)" -P

I am getting an error like this:

Enter password for new role:
Enter it again: Password:
createuser: could not connect to database postgres: FATAL: password authentication failed for user "ravi"

halfer
  • 19,471
  • 17
  • 87
  • 173
Sun
  • 3,156
  • 6
  • 47
  • 75
  • 2
    You should be running this command under "postgres" user: First, `sudo -u postgres -i`, then `createuser` and arguments. https://wiki.archlinux.org/index.php/PostgreSQL – Jan Samek Jun 16 '18 at 08:54
  • @JanSamek: `createuser -U postgres ...` should work as well (if the postgres role is allowed to login with a password) – a_horse_with_no_name Jun 16 '18 at 15:22

0 Answers0