Jump to content

[Solved] Postgres Remote Access.


patents

Recommended Posts

Hello,
Am I eligible for allowing remote access to postgres?
I am trying to work django ORM work. I tried MySQL but it doesn't work for me.
if yes:
    username: patents_plrusr
    database: patents_plrdb
    user(off course): patents
else:
    no worry.

Access to all IPs needed as I dont have static IP.

Link to comment
Share on other sites

I am still not able to access the remote db.

 

I tried.

 

DATABASES = {
    'default': {     
        
        'ENGINE': 'django.db.backends.postgresql',
        'NAME': 'patents_plrdb',                      
        'USER': 'patents_plrusr',
        'PASSWORD': '',
        'HOST': 'tommy.heliohost.org',
        'PORT': '5432',
        
    }
}
and
'HOST': '65.19.143.6',

I not able to use it. I am on windows. I think I need to try linux now.

Link to comment
Share on other sites

All that information looks right to me. Try this command

psql --username=patents_plrusr --host=tommy.heliohost.org --dbname=patents_plrdb --port=5432
If that works then you know the problem is in your django app not on your computer or remote access.
Link to comment
Share on other sites

Is installation of postgreSQL required on my machine to access remotely?

 

I tried manually using python.

 

This is the input and output:

 

In [1]: import psycopg2
In [2]: conn = psycopg2.connect(database='patents_plrdb',
   ...: user='patents_plrusr',
   ...: password='',
   ...: host='tommy.heliohost.org',
   ...: port=5432)
---------------------------------------------------------------------------
OperationalError                          Traceback (most recent call last)
<ipython-input-4-3976c641658e> in <module>()
      3 password='',
      4 host='tommy.heliohost.org',
----> 5 port=5432)


C:\Users\rahulkumar.patel\AppData\Roaming\plrplus\WinPython-32bit-3.6.2.0Qt5\python-3.6.2\lib\site-packages\psycopg2\__init__.py in connect(dsn, connection_factory, cursor_factory, **kwargs)
    128 
    129     dsn = _ext.make_dsn(dsn, **kwargs)
--> 130     conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
    131     if cursor_factory is not None:
    132         conn.cursor_factory = cursor_factory


OperationalError: could not connect to server: Connection timed out (0x0000274C/10060)
Is the server running on host "tommy.heliohost.org" (65.19.143.6) and accepting
TCP/IP connections on port 5432?
Edited by patents
Link to comment
Share on other sites

Which is fairly common for corporate networks...work has a firewall that’s blocking it. It’s a way for them to reduce the odds of company data leaving the network.

 

I have to use the insecure cpanel login on port 80 at one of my jobs for the same reason.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...