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,824
  • 17
  • 99
  • 186
Sun
  • 3,444
  • 7
  • 53
  • 83
  • 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 –  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) –  Jun 16 '18 at 15:22

0 Answers0