# is there any way to see data in database like normally we can connect our postgres database to pgAdmin?

**URL:** <https://community.fly.io/t/is-there-any-way-to-see-data-in-database-like-normally-we-can-connect-our-postgres-database-to-pgadmin/4280>\
**Category:** Questions / Help\
**Tags:** elixir, postgres, phoenix-files\
**Created:** [March 6, 2022, 3:27am UTC](https://community.fly.io/t/is-there-any-way-to-see-data-in-database-like-normally-we-can-connect-our-postgres-database-to-pgadmin/4280 "2022-03-06T03:27:28Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![usama](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/usama/32/16272_2.png) [@usama](https://community.fly.io/u/usama)\
**Post date:** [March 6, 2022, 3:27am UTC](https://community.fly.io/t/is-there-any-way-to-see-data-in-database-like-normally-we-can-connect-our-postgres-database-to-pgadmin/4280/1 "2022-03-06T03:27:28Z")

</div>

I want to see the data in tables of my database

---

<div class="post-metadata">

**Author:** ![Monroe\_Clinton](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/monroe_clinton/32/1929_2.png) [@Monroe\_Clinton](https://community.fly.io/u/Monroe_Clinton)\
**Post date:** [March 6, 2022, 12:53pm UTC](https://community.fly.io/t/is-there-any-way-to-see-data-in-database-like-normally-we-can-connect-our-postgres-database-to-pgadmin/4280/2 "2022-03-06T12:53:13Z")

</div>

If you want to check the tables in your database you can do this:

```auto
flyctl ssh console --app postgres-app-here
psql -h 127.0.0.1 -U user-you-want-here

```

Then in `psql` you can use the command `\d` to list the tables in your database.

For accessing it through pgAdmin, it’s a bit different. The database is accessed by your other apps over private networks, so you’ll need to make a tunnel between your computer and the database. You can use Wireguard to create a tunnel. Then you can connect to the database in pgAdmin with the internal address (e.g. `paulgra-ham.internal`) and your credentials.

You can read more about how to setup Wireguard with this reference:

> **[Private Networking](https://fly.io/docs/networking/private-networking/)**
>
> Documentation and guides from the team at Fly.io.

---

<div class="post-metadata">

**Author:** ![catflydotio](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/catflydotio/32/14559_2.png) [@catflydotio](https://community.fly.io/u/catflydotio)\
**Post date:** [March 6, 2022, 11:21pm UTC](https://community.fly.io/t/is-there-any-way-to-see-data-in-database-like-normally-we-can-connect-our-postgres-database-to-pgadmin/4280/3 "2022-03-06T23:21:38Z")

</div>

It’s gotten even easier! Try [`flyctl postgres connect`](https://fly.io/docs/flyctl/postgres-connect/) for `psql`, or [`flyctl proxy`](https://fly.io/docs/flyctl/proxy/) to forward a port to your local machine (that you can point pgAdmin to), without setting up your own WireGuard.

[More in the Fly Postgres docs](https://fly.io/docs/reference/postgres/#on-a-machine-with-flyctl-installed)

also:

> **[Our User-Mode WireGuard Year](https://fly.io/blog/our-user-mode-wireguard-year/)**
>
> For better or worse, flyctl isn't boring. Here's why.

---

<div class="post-metadata">

**Author:** ![usama](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/usama/32/16272_2.png) [@usama](https://community.fly.io/u/usama)\
**Post date:** [March 9, 2022, 12:07am UTC](https://community.fly.io/t/is-there-any-way-to-see-data-in-database-like-normally-we-can-connect-our-postgres-database-to-pgadmin/4280/4 "2022-03-09T00:07:49Z")

</div>

can you please help me in it I’m still not sure how to do it I have tried steps over there but it does nothing for me

```auto
usama@Usamas-MacBook-Pro chatapp % flyctl proxy 5432 -a my-db         
usama@Usamas-MacBook-Pro chatapp % psql postgres://postgres:password@localhost:5432
psql (14.1)
Type "help" for help.

postgres=#  

```

what next?

---

<div class="post-metadata">

**Author:** ![usama](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/usama/32/16272_2.png) [@usama](https://community.fly.io/u/usama)\
**Post date:** [March 9, 2022, 12:12am UTC](https://community.fly.io/t/is-there-any-way-to-see-data-in-database-like-normally-we-can-connect-our-postgres-database-to-pgadmin/4280/5 "2022-03-09T00:12:26Z")

</div>

How to connect [fly.io](http://fly.io) postgres to pg\_admin any step by step guide please

---

<div class="post-metadata">

**Author:** ![kurt](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/kurt/32/43757_2.png) [@kurt](https://community.fly.io/u/kurt)\
**Post date:** [March 9, 2022, 12:53am UTC](https://community.fly.io/t/is-there-any-way-to-see-data-in-database-like-normally-we-can-connect-our-postgres-database-to-pgadmin/4280/6 "2022-03-09T00:53:19Z")

</div>

Did you let the `proxy` command keep running? You can’t cancel it, it needs to stay running in a tab.

That `psql` command looks like it might have worked. You could also connect from something like Postico, which is a little easier than a CLI. If you want to use `psql` you can actually run:

```auto
flyctl pg connect -a <db-name>

```

Then follow these instructions: [psql command line tutorial and cheat sheet | postgres](https://tomcam.github.io/postgres/)

---

<div class="post-metadata">

**Author:** ![usama](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/usama/32/16272_2.png) [@usama](https://community.fly.io/u/usama)\
**Post date:** [March 9, 2022, 1:09am UTC](https://community.fly.io/t/is-there-any-way-to-see-data-in-database-like-normally-we-can-connect-our-postgres-database-to-pgadmin/4280/7 "2022-03-09T01:09:19Z")

</div>

> [@kurt](#):
>
> `flyctl pg connect -a <db-name>`

 ![Screenshot 2022-03-09 at 1.08.23 AM](https://global.discourse-cdn.com/fly1/original/3X/4/e/4e145dc6d247ee8d42cf9f48247086d7ec845a22.png)  
want to connect it here this is not working for me commands are working fine

---

<div class="post-metadata">

**Author:** ![catflydotio](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/catflydotio/32/14559_2.png) [@catflydotio](https://community.fly.io/u/catflydotio)\
**Post date:** [March 9, 2022, 2:10am UTC](https://community.fly.io/t/is-there-any-way-to-see-data-in-database-like-normally-we-can-connect-our-postgres-database-to-pgadmin/4280/8 "2022-03-09T02:10:13Z")

</div>

You’ve forwarded the database port to port 5432 on your computer (localhost).

At this point it’s just a matter of setting up pgAdmin or whatever other client you want to use. [Server Dialog — pgAdmin 4 6.5 documentation](https://www.pgadmin.org/docs/pgadmin4/6.5/server_dialog.html)

---

<div class="post-metadata">

**Author:** ![cschull](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/cschull/32/4312_2.png) [@cschull](https://community.fly.io/u/cschull)\
**Post date:** [July 18, 2022, 2:35pm UTC](https://community.fly.io/t/is-there-any-way-to-see-data-in-database-like-normally-we-can-connect-our-postgres-database-to-pgadmin/4280/9 "2022-07-18T14:35:27Z")

</div>

> [@usama](#):
>
> pg\_admin

I would need the same! I’ve been trying to set up my database in Postico and the pg\_admin steps aren’t clear to me

---

<div class="post-metadata">

**Author:** ![usama](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/usama/32/16272_2.png) [@usama](https://community.fly.io/u/usama)\
**Post date:** [July 18, 2022, 4:59pm UTC](https://community.fly.io/t/is-there-any-way-to-see-data-in-database-like-normally-we-can-connect-our-postgres-database-to-pgadmin/4280/10 "2022-07-18T16:59:40Z")

</div>

did you found the solution?

---

<div class="post-metadata">

**Author:** ![lubien](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/lubien/32/41919_2.png) [@lubien](https://community.fly.io/u/lubien)\
**Post date:** [July 18, 2022, 6:28pm UTC](https://community.fly.io/t/is-there-any-way-to-see-data-in-database-like-normally-we-can-connect-our-postgres-database-to-pgadmin/4280/11 "2022-07-18T18:28:26Z")

</div>

> [@cschull](#):
>
> I’ve been trying to set up my database in Postico and the pg\_admin steps aren’t clear to me

Hi @cschull and @usama !

This is how I’d set my database to be accessible on localhost.

On your terminal write the command:

```sh
$ fly proxy 6543:5432 -a app-name
Proxying local port 6543 to remote [app-name.internal]:5432

```

This command will expose the port 5432 from your app to your localhost:6543 (feel free to change this number)

On your Postico/Client app do this

 ![image](https://global.discourse-cdn.com/fly1/original/3X/1/d/1da1c09ff77102148faeb00d91f35184fa892d0e.png)

The host should be `localhost` and the port should be the one you choose (in my example 6543).

Read more: [Fly Postgres · Fly Docs](https://fly.io/docs/reference/postgres/#connecting-to-postgres-from-outside-fly)

---

<div class="post-metadata">

**Author:** ![usama](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/usama/32/16272_2.png) [@usama](https://community.fly.io/u/usama)\
**Post date:** [November 28, 2022, 10:29pm UTC](https://community.fly.io/t/is-there-any-way-to-see-data-in-database-like-normally-we-can-connect-our-postgres-database-to-pgadmin/4280/12 "2022-11-28T22:29:22Z")

</div>

fly proxy 6543:5432 -a app-name  
taking to long to respond any idea?

---

<div class="post-metadata">

**Author:** ![zormax](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/zormax/32/8674_2.png) [@zormax](https://community.fly.io/u/zormax)\
**Post date:** [January 16, 2023, 3:49pm UTC](https://community.fly.io/t/is-there-any-way-to-see-data-in-database-like-normally-we-can-connect-our-postgres-database-to-pgadmin/4280/13 "2023-01-16T15:49:34Z")

</div>

Hi, this solves the connection problem. I can connect to my database using dbeaver client app but unfortunately, I cannot see the tables. How can this be fixed? I am sure tables exist because my app can query database but just I can’t see them.

![image_2023-01-17_125158871](https://global.discourse-cdn.com/fly1/original/3X/e/f/ef735c95ddfd40db2aa0b006fdb5d02cb99b9b74.png)

 ![dbeaver_CvQMYt4bC8](https://global.discourse-cdn.com/fly1/original/3X/7/d/7dfc2d22551b782e6f707f0937e90148988fedf7.png)

---

<div class="post-metadata">

**Author:** ![Teslima02](https://avatars.discourse-cdn.com/v4/letter/t/b487fb/32.png) [@Teslima02](https://community.fly.io/u/Teslima02)\
**Post date:** [January 25, 2023, 4:15pm UTC](https://community.fly.io/t/is-there-any-way-to-see-data-in-database-like-normally-we-can-connect-our-postgres-database-to-pgadmin/4280/14 "2023-01-25T16:15:56Z")

</div>

Edit your databse and check show all database

 ![image](https://global.discourse-cdn.com/fly1/original/3X/f/6/f60ad5e0f221d07d5abe5b2edd47d78dab2b0e8f.png)

---

<div class="post-metadata">

**Author:** ![zormax](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/zormax/32/8674_2.png) [@zormax](https://community.fly.io/u/zormax)\
**Post date:** [January 25, 2023, 7:13pm UTC](https://community.fly.io/t/is-there-any-way-to-see-data-in-database-like-normally-we-can-connect-our-postgres-database-to-pgadmin/4280/15 "2023-01-25T19:13:39Z")

</div>

Thanks, but I can see all databases. Can’t see just tables. Maybe this is a bug of Dbeaver.

---

<div class="post-metadata">

**Author:** ![Teslima02](https://avatars.discourse-cdn.com/v4/letter/t/b487fb/32.png) [@Teslima02](https://community.fly.io/u/Teslima02)\
**Post date:** [February 2, 2023, 7:29pm UTC](https://community.fly.io/t/is-there-any-way-to-see-data-in-database-like-normally-we-can-connect-our-postgres-database-to-pgadmin/4280/16 "2023-02-02T19:29:48Z")

</div>

This is how you will get the table you’re looking for  
 ![image](https://global.discourse-cdn.com/fly1/original/3X/2/5/25b635370ee5ed9eb1067713ebb68127cadb356e.png)

---

<div class="post-metadata">

**Author:** ![georgers](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/georgers/32/15048_2.png) [@georgers](https://community.fly.io/u/georgers)\
**Post date:** [September 9, 2023, 7:19pm UTC](https://community.fly.io/t/is-there-any-way-to-see-data-in-database-like-normally-we-can-connect-our-postgres-database-to-pgadmin/4280/17 "2023-09-09T19:19:29Z")

</div>

Hi Usama,

Did you happen to find a solution for this? I seem to be having the exact same issues as you.

Thanks,  
George.

---

<div class="post-metadata">

**Author:** ![Rivert](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/rivert/32/37993_2.png) [@Rivert](https://community.fly.io/u/Rivert)\
**Post date:** [October 3, 2024, 9:37pm UTC](https://community.fly.io/t/is-there-any-way-to-see-data-in-database-like-normally-we-can-connect-our-postgres-database-to-pgadmin/4280/18 "2024-10-03T21:37:14Z")

</div>

could somebody put a example with pgadmin, because its gave me a error, telling me: connection refused (0x0000274D/10061)

---

<div class="post-metadata">

**Author:** ![lubien](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/lubien/32/41919_2.png) [@lubien](https://community.fly.io/u/lubien)\
**Post date:** [October 4, 2024, 10:30am UTC](https://community.fly.io/t/is-there-any-way-to-see-data-in-database-like-normally-we-can-connect-our-postgres-database-to-pgadmin/4280/19 "2024-10-04T10:30:08Z")

</div>

99% of the time when I have connection refused it’s when I use the wrong host or I forget to set a host.

I’m not familiar with pgadmin but you’d want to check if the host (or the entire connection string if that’s the case) has the proper `db-app-name.internal` or `db-app-name.flycast` (if you have a fly cast IP there).

---

<div class="post-metadata">

**Author:** ![dentalmap](https://avatars.discourse-cdn.com/v4/letter/d/53a042/32.png) [@dentalmap](https://community.fly.io/u/dentalmap)\
**Post date:** [November 18, 2024, 4:56pm UTC](https://community.fly.io/t/is-there-any-way-to-see-data-in-database-like-normally-we-can-connect-our-postgres-database-to-pgadmin/4280/20 "2024-11-18T16:56:20Z")

</div>

The way that worked for me was to expose the port on my machine and when configuring the server in pgAdmin, define the hostname as localhost
