snippetsqlMinor
psql asks for password, CREATE USER didn't specify one
Viewed 0 times
didncreateuserpasswordpsqloneforspecifyasks
Problem
I used to have a user, say 'jack' in postgresql, and then I forgot what the password. I reassigned all its ownerships to user postgres, removed the user, and then created it again with
Now if I try to connect with it, psql asks for a password.
What is going on and how do I check if a user has a password or not?
CREATE USER jack;.Now if I try to connect with it, psql asks for a password.
$ psql db_name jack
Password for user jack:
psql: fe_sendauth: no password suppliedWhat is going on and how do I check if a user has a password or not?
Solution
A user having a password or not won't affect if you're asked for a password when trying to connect. That is controlled by the
If you're being asked for a password that indicates that a password is required. If you try to connect to an account which doesn't have a password set that will simply fail. You need to either set a password for the account and use that, use a different type of connection or modify the
pg_hba.conf file.If you're being asked for a password that indicates that a password is required. If you try to connect to an account which doesn't have a password set that will simply fail. You need to either set a password for the account and use that, use a different type of connection or modify the
pg_hba.conf file to use a different authentication method.Context
StackExchange Database Administrators Q#35561, answer score: 4
Revisions (0)
No revisions yet.