Search code examples
postgresqlazurelocalhostpostgresql-16

Problem with connecting to postgresql in azure data studio


so today I was trying to install postgresql database and I decided to not use pgAmin4 so I didn't even install it. instead I want to use azure data studio for the DB interface. I think the first step is to create a connection to the postgres. by which I installed the extension first and tried to create a postgresql connection. filled the server name with LocalHost and I don't know what Should I put in the username and password field. I don't know the default values, and I didn't change it at all. (never installed any database on this windows before) the only unusual thing is that I changed the data folder directory to another drive.

I've tried using admin and postgres as username but each time an error occurs saying the password or username is not valid(or something like that)


Solution

  • The Postgres database does not have a default password. It is generated during the installation of Postgres SQL on a Windows machine, and the user is also specified at that time, as shown below:

    enter image description here

    You can use these as the username and password when connecting to the Postgres database in Azure Data Studio:

    enter image description here

    The connection will be successful, as shown below:

    enter image description here

    If you use pgAdmin, you can change the password for the user, as shown below:

    enter image description here