1

How to access local postgreSQL server running on computer, from mobile my phone?

I am making flutter app and use pgAdmin v6.10 as local server. I'm stuck for 2days trying different solutions to access server from my mobile browser but no progress.

I believe if i can access local server through mobile browser, also i can send data from my flutter app to database.

My pgAdmin runs on pc browser nicely but on phones browser doesn't open, I've tried addresses 192.168.43.12:port(i.e computer's ip:port number) and 127.0.0.1:port but they all didn't work, i get ERR_CONNECTION_REFUSED Also i added this line on pg_hba.conf file

TYPE  DATABASE        USER            ADDRESS                 METHOD 
host  flutterdb   flutterdb_admin      192.168.43.12/24     scram-sha-256

And on my postgresql.conf file there is

listen_addresses = '*'

I'm following tutorial series from: https://youtu.be/WFe1kZhvUIw

I need your help please.

NOTE: I am using Windows laptop

dingoo
  • 121
  • 1
  • 4
  • Assuming you are making a wireless connection from you phone to the `192.168.43.x` network then best bet is that `ERR_CONNECTION_REFUSED` means there is firewall on your laptop blocking connections the `port`. – Adrian Klaver Jul 21 '22 at 18:41
  • PgAdmin4 is not a database, it is a client. But it does include a web-server component. Are you trying to connect to a PostgreSQL database server, or to a PgAdmin4 webserver? – jjanes Jul 21 '22 at 23:50
  • "How to access local postgreSQL server" What does this mean? "local" usually means two things are running on the same machine (like your tty terminal and your database). One thing is always local to itself, so what are you trying to imply here? – jjanes Jul 21 '22 at 23:53
  • It is pgAdmin webserver, Sorry may be it wasn't clear cause I am a newbie. @jjanes – dingoo Jul 22 '22 at 04:31
  • I have disabled my firewall and real time protection but still it is accessible on my PC only but not accessible on mobile phone @AdrianKlaver – dingoo Jul 22 '22 at 04:37

1 Answers1

-1

i think that if u have dev environment, just you can try to open the connection..

you can try to configure for accept all connections How to configure PostgreSQL to accept all incoming connections

  • I've tried this but still doesn't connect, There must be some **issue with this pgAdmin4 webserver** because, I tried **XAMPP** to see if there is the same problem but, it turn out that I can access it in my **mobile browser** and even on my **Virtua Machine** . Still I'm working on solving this issue with pgAdmin4. @BryanContreras – dingoo Jul 22 '22 at 07:06