Ir para conteúdo

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

razstec

conectar remotamente a postgresql

Recommended Posts

viva, tenho o postgresql instalo numa maquina em ubunto a funcionar tudo na perfeição, agora precisa de ligar um pc com windows vista na mesma rede a essa bd, tenho tentado com pgadmin3 e putty e nada, da-me sempre erro de conexao.

Alguem me da uma ajuda nisto?

Obrigado

Compartilhar este post


Link para o post
Compartilhar em outros sites

Ola, com que método você ta tentando realizar essa conexão ?

- Primeiramente, você deve delegar as permissões para uma outra determinada rede acessar sua base local, ou permissão 'all' de acesso remoto a mesma. Permissão esta continda no arquivo pg_hba.conf, localizado dentro da pasta data na raiz da instalação do postgre.

 

Segue alguns exemplos de como configurar o mesmo.

 

# Allow any user on the local system to connect to any database under
# any user name using Unix-domain sockets (the default for local
# connections).
#
# TYPE  DATABASE    USER        IP-ADDRESS        IP-MASK           METHOD
local   all         all                                             trust

# The same using local loopback TCP/IP connections.
#
# TYPE  DATABASE    USER        IP-ADDRESS        IP-MASK           METHOD
host    all         all         127.0.0.1         255.255.255.255   trust     

# Allow any user from any host with IP address 192.168.93.x to connect
# to database "template1" as the same user name that ident reports for
# the connection (typically the Unix user name).
# 
# TYPE  DATABASE    USER        IP-ADDRESS        IP-MASK           METHOD
host    template1   all         192.168.93.0      255.255.255.0     ident sameuser

# Allow a user from host 192.168.12.10 to connect to database
# "template1" if the user's password is correctly supplied.
# 
# TYPE  DATABASE    USER        IP-ADDRESS        IP-MASK           METHOD
host    template1   all         192.168.12.10     255.255.255.255   md5

# In the absence of preceding "host" lines, these two lines will
# reject all connection from 192.168.54.1 (since that entry will be
# matched first), but allow Kerberos V connections from anywhere else
# on the Internet.  The zero mask means that no bits of the host IP
# address are considered so it matches any host.
# 
# TYPE  DATABASE    USER        IP-ADDRESS        IP-MASK           METHOD
host    all         all         192.168.54.1      255.255.255.255   reject
host    all         all         0.0.0.0           0.0.0.0           krb5

# Allow users from 192.168.x.x hosts to connect to any database, if
# they pass the ident check.  If, for example, ident says the user is
# "bryanh" and he requests to connect as PostgreSQL user "guest1", the
# connection is allowed if there is an entry in pg_ident.conf for map
# "omicron" that says "bryanh" is allowed to connect as "guest1".
#
# TYPE  DATABASE    USER        IP-ADDRESS        IP-MASK           METHOD
host    all         all         192.168.0.0       255.255.0.0       ident omicron

# If these are the only three lines for local connections, they will
# allow local users to connect only to their own databases (databases
# with the same name as their user name) except for administrators and
# members of group "support" who may connect to all databases.  The file
# $PGDATA/admins contains a list of user names.  Passwords are required in
# all cases.
#
# TYPE  DATABASE    USER        IP-ADDRESS        IP-MASK           METHOD
local   sameuser    all                                             md5
local   all         @admins                                         md5
local   all         +support                                        md5

# The last two lines above can be combined into a single line:
local   all         @admins,+support                                md5

# The database column can also use lists and file names, but not groups:
local   db1,db2,@demodbs  all                                       md5

 

Fonte (Inglês)

 

Fonte (Português)

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.