In PostgreSQL why does command line window disappear when I press Enter after entering my password?

左心房为你撑大大i 提交于 2020-01-24 14:15:46

问题


I installed PostgreSQL on my laptop today (running Windows 10) and I am trying to get started learning SQL. The PostgreSQL Installation Tutorial said to try connecting using command prompt, by opening psql.exe, so I did that, got the command window, and it asked me for my password. I entered that and pressed the Enter key -- and the window disappeared. Multiple times. The password is definitely correct.

What did I do wrong? I've looked hard for info about this but have not found answers. I'm just trying to be sure my setup is correct and ready to go.

Thanks for any suggestions.


回答1:


I faced the same issue and the reason is by default the SQL connection uses windows username(the user with which you are logged in) while this user is not created on the DB.

Use the following command while login: C:\Program Files\PostgreSQL\12\bin>psql.exe -d postgres -U postgres



来源:https://stackoverflow.com/questions/45021440/in-postgresql-why-does-command-line-window-disappear-when-i-press-enter-after-en

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!