мой первый вопрос размещен здесь.Как подключить виртуальный клиент PostgreSQL к серверу на физическом компьютере?
Прямо сейчас у меня есть ноутбук с Ubuntu 12,04 работает PostgreSQL 9,01 на той же машине, у меня есть виртуализированная Fedora 18 работает под VirtualBox 4.2.12.
На этой виртуализованной Fedora у меня есть PostgreSQL клиент и вы хотите подключиться к серверу PostgreSQL, работающему на Ubuntu.
я редактировал файл /etc/postgresql/9.1/main/postgresql.conf
на сервере Ubuntu, чтобы разрешить соединения:
listen_addresses = '*'
А также я редактирую файл /etc/postgresql/9.1/main/pg_hba.conf на то же самое Ubuntu, чтобы позволить Postgres пользователей к Конеке тесту базы данных:
local postgres test md5
Но когда я пытаюсь соединиться с Fedora на pgadmin3 появляется следующее сообщение об ошибке:
Access to database denied
The server doesn't grant access to the database: the server reports
FATAL: no pg_hba.conf entry for host "192.168.1.239", user "postgres", database "jpa",
SSL on FATAL: no pg_hba.conf entry for host "192.168.1.239", user "postgres",
database "jpa", SSL off
To access a database on a PostgreSQL server, you first have to grant primary access
to the server for your client (Host Based Authentication).
PostgreSQL will check the pg_hba.conf file if a pattern that matches
your client address/username/database is present and enabled before any
SQL GRANT access control lists are evaluated.
The initial settings in pg_hba.conf are quite restrictive, in order to avoid
unwanted security holes caused by unreviewed but mandatory system settings.
You'll probably want to add something like host all all 192.168.0.0/24 md5
This example grants MD5 encrypted password access to all databases to all users
on the private network 192.168.0.0/24.
You can use the pg_hba.conf editor that is built into pgAdmin III
to edit the pg_hba.conf configuration file.
After changing pg_hba.conf, you need to trigger a server configuration reload
using pg_ctl or by stopping and restarting the server process.
Мой pg_hba.conf является:
# Database administrative login by Unix domain socket
local all postgres peer
# TYPE DATABASE USER ADDRESS METHOD
# "local" is for Unix domain socket connections only
local all all peer
# IPv4 local connections:
host all all 127.0.0.1/32 md5
host all all 10.0.2.15/16 md5
#local postgres postgres md5
#local postgres jpa md5
#local postgres test md5
# IPv6 local connections:
host all all ::1/128 md5
# Allow replication connections from localhost, by a user with the
# replication privilege.
#local replication postgres peer
#host replication postgres 127.0.0.1/32 md5
#host replication postgres ::1/128 md5
И 10.0.2.15 это IP виртуализированной Fedora.
Спасибо!
Фактически команда GRANT: ПРЕДОСТАВЛЕНИЕ ВСЕХ ПРИВИЛЕГИЙ НА БАЗЕ ДАННЫХ jpa К postgres с возможностью гранта; но до сих пор нет связи с Fedora –
@Saija Я редактировал свой пост. – Kai
Я просто попробую: «host all all samenet md5» и «host all all samehost md5' на pg_hba.conf и оба варианта работали !! –