Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PSQL: Unable to enter password

I have installed postgreSQL version 11.1 on my windows-x64 laptop and I'm able to access the database through pgAdmin 4.

However I can't access the database through command prompt. It ask's password but doesn't allows to enter. I have tried re-installing the software but it didn't work.Also, I have added bin & lib folder path to Enviorment variables. Please advise.

enter image description here

Error message : Password authentication failed for user abc

enter image description here

like image 703
Santosh Avatar asked Dec 18 '22 18:12

Santosh


2 Answers

You can enter your password just fine. The password does not show up in the terminal when you type it, but that is for security reasons. Just try typing your password out, and hitting enter.

If your password was entered correctly, the action will continue. If your password was spelled wrong, it will prompt you to enter it again. It worked for me.

like image 53
Madao Avatar answered Jan 03 '23 08:01

Madao


When you start your terminal, you're logged in as you (aka NOT postgres). So, when connecting to psql via terminal, you have to specify the user (in this case, postgres). So, from your terminal, you would type: psql <database you want to connect to> <'postgres' or whatever postgres user you want to log in as>. Then it'll prompt you for password: either hit enter if no password or type password. Then it should connect you to psql.

Other workaround of course is to start psql

like image 27
Aneesh Avatar answered Jan 03 '23 10:01

Aneesh