Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 799 Vote(s) - 3.52 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Unable to connect to server: PgAdmin 4

#11
press win key+R then Search for services.msc A window will open in that find postgresql-x64-13 right click, in that tab click start option For me its works perfectly.
Check out this stackoverflow link

[To see links please register here]

Reply

#12
I was running postgress and pgadmin both using docker container.

```sh
sudo docker ps

sudo docker inspect <postgress_container_id>
```

Output:

"Networks": {
"work_file_default": {
"IPAMConfig": null,
"Links": null,
"Aliases": [
"postgres",
"578a7a1050d1"
],
"NetworkID": "49dbe9d7280b55e36afc4308469c1b55e051d7eea8f1c03f08728e652cf22b5b",
"EndpointID": "c30a642c5a0f2970147c9734cadfbe1e8d7c29fcba8a83a628b7c2b3db114716",
"Gateway": "172.18.0.1",
**"IPAddress": "172.18.0.4",**
"IPPrefixLen": 16,
"IPv6Gateway": "",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"MacAddress": "02:42:ac:12:00:04",
"DriverOpts": null
}

Instead of `localhost` put the IP obtained from above command (`172.18.0.4`)
Reply

#13
In my case was I got both pgadmin and postgresql services running in **separate docker containers** and I was trying to connect to localhost(127.0.0.1), which is cause of *unable to connect to server* error.

[![enter image description here][1]][1]

*Note*: 5438 port on my computer (host machine) was mapped to 5432 port of postgresql container.

so practically there are two solutions (if you have these services in separate containers and you have mapped postgresql port to your host machine ):

1-find out your local IP (mine is 192.168.1.106) and put it in the Host field.

[![enter image description here][2]][2]

2- you can put two containers(pgadmin and postgres) in one network (docker network)
and instead of your local IP, put postgres container IP in the Host field.


[1]:

[2]:


-Another tip that may help: what I've recently find out was if you are linux user and have **ufw** enabled, you should allow the port.

e.g. on my computer postgres is running on 5438 port, so I performed below command (so I could connect from pgadmin container to 5438 port of host wich postgres is running)

ufw allow 5438
Reply

#14
how I solved this problem in ubuntu 22.04

1. I didn't have a password set in Postgres, that's why the error occurred 'unable to connect server 127.0.0.0 port 5432

2. Open the terminal in ubuntu and enter this command;
`sudo -u postgres psql`

3. Run the statement to add new password. `ALTER USER Postgres PASSWORD 'AddNewPasswordHere';` in '' you should enter your new password

**Example**:

1)sudo -u postgres psql

2)ALTER USER postgres PASSWORD 'mynewpassword'

3)sudo service postgresql restart

4)Then you can create a server in pgadmin
Reply

#15
Execute the container with the data Eg:

docker run --name postgresdb -e POSTGRES_USER=username -e POSTGRES_PASSWORD=password -e POSTGRES_DB=mydb -p 5432:5432 --restart always -d postgres

Then in the PGAdmin client in the Host Name/Address use:

host.docker.internal

[Image Conn PGAdmin][1]


[1]:
Reply

#16
If you already tried with “127.0.0.1” and it didn’t work then use “localhost”
Reply

#17
You may need to installing PostgreSQL Server first.
___
You can verify if the folder is created in the below folder,
C:\Program Files\PostgreSQL (for Windows) or /etc/postgresql/{version}/main (for Linux / MacOS).
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through