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"

2
  • 2
    You should be running this command under "postgres" user: First, sudo -u postgres -i, then createuser and arguments. wiki.archlinux.org/index.php/PostgreSQL Commented Jun 16, 2018 at 8:54
  • @JanSamek: createuser -U postgres ... should work as well (if the postgres role is allowed to login with a password) Commented Jun 16, 2018 at 15:22

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.