为什么我不能从RazorSQL连接到PostgreSQL?

时间:2017-12-08 20:56:48

标签: postgresql jdbc connection tcp-ip razorsql

我在OS X 10.12.6的VirtualBox VM中运行CentOS 7.4.1708(安装了所有软件更新)的PostgreSQL 9.2.23。昨天我有这个工作,但我的VM被软管,我不得不从头开始重新创建它。现在我无法使用RazorSQL从主机连接。

我做了以下事情:

su root
systemctl disable firewalld
yum install postgresql-server 
postgresql-setup initdb
chkconfig postgresql on 
reboot

edit /var/lib/pgsql/data/pg_hba.conf:

# "local" is for Unix domain socket connections only
local   all             all                                     trust
# IPv4 local connections:
host    all             all             0.0.0.0/0               trust

edit /var/lib/pgsql/data/postgresql.conf:

listen_addresses = '*'              # what IP address(es) to listen on;

systemctl restart postgresql.service

sudo -u postgres psql
create user robert with password 'robert';
create database robertdb;
grant all on database robertdb to robert;
\q
psql -U robert -d robertdb;
create schema robert;
alter role robert set search_path to robert;
\q

RazorSQL错误是:

ERROR: An error occurred while trying to connect to the database:
JDBC URL: jdbc:postgresql://192.168.7.53:5432/robertdb
The connection attempt failed.

IP地址是正确的,我可以从主机ping它,因为我昨天能够连接,我知道驱动程序不是问题。

的Mac:

Port Scanning host: 192.168.7.53

     Open TCP Port:     22          ssh
     Open TCP Port:     111         sunrpc
     Open TCP Port:     5432        postgresql
Port Scan has completed…

CentOS的:

Nmap scan report for localhost (127.0.0.1)
Host is up (0.00028s latency).
Other addresses for localhost (not scanned): 127.0.0.1
Not shown: 995 closed ports
PORT     STATE SERVICE
22/tcp   open  ssh
25/tcp   open  smtp
111/tcp  open  rpcbind
631/tcp  open  ipp
5432/tcp open  postgresql

root@localhost robert]# cat /var/lib/pgsql/data/postgresql.conf | grep "listen"
listen_addresses = '*'              # what IP address(es) to listen on;

[root@localhost robert]# cat /var/lib/pgsql/data/pg_hba.conf | grep "trust"
# METHOD can be "trust", "reject", "md5", "password", "gss", "sspi",
local   all             all                                     trust
host    all             all             0.0.0.0/0               trust

尝试将Postz消除RazorSQL作为问题并将其连接起来。奇怪。

0 个答案:

没有答案