Поиск по ключевым словам

VetAIS — allow database connect from Internet/local network

PostgreSQL server have in most cases allowed connection from localhost only.
Network connection are not permitted. If you are interested to allow any network connection, it can be from another local LAN network or also from Internet, you need to edit configuration of PostgreSQL.

Note: for Internet access you probably need to configure your router or another device you use for internet access on side where is database!

PostgreSQL configuration of access is stored in file «pg_hba.conf«, on Windows systems is stored in «c:\vetais_data\«.

Here, on the end of file you can see list of IP or network segments allowed to connect. For example here is part of configuration that allowed localhost only.

# TYPE  DATABASE        USER            ADDRESS                 METHOD
# IPv4 local connections:
host    all             all             127.0.0.1/32            md5

For allow connect local network for example with segment 192.168.1.0/24 add this line:

host    all             all             192.168.1.0/24            md5

If you are interested to allow remote IP via Internet access, you need first to check your remote IP (for example to open on client! PC site www.myip.dk). On this page you will see, for example IP 1.2.3.4.
Then add this line into configuration:

host    all             all             1.2.3.4/32            md5

Please, always restart PostgreSQL server to make changes valid.

Добавить комментарий