microsoft / vscode-postgresql

PostgreSQL extension for VSCODE
Other
393 stars 50 forks source link

Cannot connect to PostgreSQL #67

Open 12major opened 4 years ago

12major commented 4 years ago

Steps to Reproduce:

  1. I set the hostname to be "localhost"
  2. PostgreSQL user "postgres"
  3. I don't know what kind of password it expects
  4. Standard connection selected

Error received is "connect ECONNREFUSED 127.0.0.1:5432" What's the required password to set a connection?

charlesonunze commented 4 years ago

The password is the password you set up in the installation wizard. Username is postgres.

coderamins commented 3 years ago

I have the same problem ! anybody help pleaseeeeeeeee!

ahmedhamdyfathy commented 2 years ago

I have the same problem but I have downloaded The wizard on the pc first and installed , after that added the extension in VSC and normally worked

glentner commented 1 year ago

I'm going to comment here in case others have found their way to the same.

On macOS if you install PostgreSQL in the typical fashion with Homebrew it sets up the default access through your user account without a password. On localhost you can connect simply be virtual of being local and I think filesystem permissions. So when the dialog asks you for a password, there is no password.

To make the extension work, I created a new user account for the project with a password, and for the hostname\instance just gave localhost, and it was happy.

Maybe there would be a way to allow it to neglect user and password as it does for default database?