问题
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