如何从主机访问hadoop VM中的PostgreSQL

时间:2018-07-12 12:13:50

标签: linux postgresql

我正在尝试通过VM hadoop连接到PostgreSQL,并验证了可以访问的数据库类型:

#sudo su postgres -c 'psql -l'

 postgres      | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =Tc/postgres
               |          |          |             |             | postgres=CTc/
               |          |          |             |             | rangerdba=CTc

我在root # postgres的奔跑中收到此消息:

"root" execution of the PostgreSQL server is not permitted.
The server must be started under an unprivileged user ID to prevent
possible system security compromise.  See the documentation for
more information on how to properly start the server.

我尝试通过登录登录

my_login # postgres

    postgres does not know where to find the server configuration file.
    You must specify the --config-file or -D invocation option or set the PGDATA env

我尝试过:

#  psql -l
 psql: FATAL:  no pg_hba.conf entry for host "[local]", user "my_login", database "postgres", SSL off

我更改了文件pg_hba.conf并添加了:

local all my_login peer

但是我总是收到相同的消息,并且我不访问postgres。 怎样用postgresql来创建数据库?

0 个答案:

没有答案