Z
Z
zlodiak2019-04-06 10:38:11
PostgreSQL
zlodiak, 2019-04-06 10:38:11

Why is the user not being created?

I installed postgres on linux mint, logged in as a superuser and try to create a user who has a login / password, and who cannot create a database, can log in, cannot create superusers:

[email protected] ~ $ sudo -i -u postgres
[sudo] password for kalinin: 
[email protected] ~ $ man createuser
[email protected] ~ $ createuser -W qwerty -U qwerty -h localhost -S -R -l -D
Password: 
createuser: could not connect to database postgres: FATAL:  password authentication failed for user "qwerty"
FATAL:  password authentication failed for user "qwerty"

During the creation process, the system asks me to enter some kind of password. I don't understand what password is required, because under the superuser I logged in without any password, but simply by doing this:
[email protected] ~ $ sudo -i -u postgres
Please tell me how can I still create a user?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Gornostaev, 2019-04-06
@zlodiak

The key -Uspecifies the login not of the newly created user, but of the user who creates it, under which the utility connects to the DBMS.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question