简体   繁体   English

在yocto上远程访问Postgresql

[英]Remote access to postgresql on yocto

Since I am using yocto everything is a bit different. 由于我使用yocto,所以一切都有些不同。 Using common linux systems (such as ubuntu) postgresql is running out of the box and I know how to access it via editing pg_hba.conf. 使用普通的linux系统(例如ubuntu),postgresql已经开箱即用,我知道如何通过编辑pg_hba.conf来访问它。

On yocto everything seems to be a bit different. 在yocto上,一切似乎都有些不同。 Here is what I tried: 这是我尝试过的:

  • After starting yocto postgres is not running. yocto启动后,postgres没有运行。 I checked that with netstat -tulpn 我用netstat -tulpn检查
  • Therefore I switched to user "postgresql" (has been created by me) and started postgres: pg_ctl start -D /my/path/to/dbFolder . 因此,我切换到用户“ postgresql”(由我创建)并启动了postgres: pg_ctl start -D / my / path / to / dbFolder Log says: 日志说:

database system is ready to accept connections 数据库系统已准备好接受连接

netstat shows me now that a local port has been opened: netstat现在向我显示已打开本地端口:

tcp 0 0 127.0.0.1:5432 0.0.0.0:* LISTEN 266/postgres tcp 0 0 127.0.0.1:5432 0.0.0.0:* LISTEN 266 / postgres

However, my pg_hba.conf includes the following line: 但是,我的pg_hba.conf包含以下行:

host all all 0.0.0.0/0 trust 托管所有0.0.0.0/0信任

But pgAdmin III on my remote system reports 但是我的远程系统上的pgAdmin III报告

could not connect to server: Connection refused (0x0000274D/10061) 无法连接到服务器:连接被拒绝(0x0000274D / 10061)

What might be the problem? 可能是什么问题?

Edit postgresql.conf, 编辑postgresql.conf,

listen_adresses = '*'
port = 5432

pg_ctl restart pg_ctl重新启动

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM