首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何为我的pgAudit安装PostgreSQL10?

如何为我的pgAudit安装PostgreSQL10?
EN

Stack Overflow用户
提问于 2018-09-26 13:31:47
回答 1查看 902关注 0票数 2

我想在我的pgAudit 6 32位上安装CentOS,我已经从从DBEnterprise下载的PostgreSQL Linux运行安装程序中安装了PostgreSQL 10 + pgAdmin4。

我遵循了这里的指南,下面是我遵循的步骤:

  1. git clone https://github.com/postgres/postgres.git
  2. cd postgres进入文件夹,然后按git checkout REL_10_STABLE
  3. ./configure之后的make install -s
  4. cd contrib
  5. 用pgAudit克隆git clone https://github.com/pgaudit/pgaudit.git扩展
  6. cd pgaudit
  7. git checkout REL_10_STABLE
  8. make -s check
  9. make install

我被困在第八步了。结果是:

代码语言:javascript
复制
[root@localhost pgaudit]# make -s check
============== creating temporary instance            ==============
============== initializing database system           ==============

pg_regress: initdb failed
Examine /root/postgres/contrib/pgaudit/log/initdb.log for the reason.
Command was: "initdb" -D "/root/postgres/contrib/pgaudit/./tmp_check/data" --no-clean --no-sync > "/root/postgres/contrib/pgaudit/log/initdb.log" 2>&1
make: *** [check] Error 2

我按照它告诉我的方式打开了initdb.log at /root/postgres/contrib/pgaudit/log/initdb.log,它说:

代码语言:javascript
复制
Running in no-clean mode.  Mistakes will not be cleaned up.
initdb: cannot be run as root
Please log in (using, e.g., "su") as the (unprivileged) user that will
own the server process.

因此,在以postgres身份登录后,我再试一次,结果如下:

代码语言:javascript
复制
bash-4.1$ make -s check
make[3]: stat: ../../src/include/utils/errcodes.h: Permission denied
/bin/sh: line 0: cd: utils/: Not a directory
make[3]: *** [../../src/include/utils/errcodes.h] Error 1
make[2]: *** [submake-errcodes] Error 2
make[1]: *** [submake-libpgport] Error 2
make: *** [submake] Error 2

我对Linux和PostgreSQL都很陌生,所以我不知道为什么失败,以及解决这个问题的方法是什么。提前感谢!

EN

回答 1

Stack Overflow用户

发布于 2022-05-11 11:25:54

看起来就像您的db用户没有登录shell。

你可以尝试:

代码语言:javascript
复制
sudo -u postgres psql template

或者:

代码语言:javascript
复制
sudo -u postgres bash
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/52518994

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档