gpt4 book ai didi

database - postgresql 给出权限问题

转载 作者:行者123 更新时间:2023-11-29 13:36:32 25 4
gpt4 key购买 nike

Postgresql 不合作。我做了一个 yum of postgresql 和 postgresql-server,这似乎很好。然后我尝试``,它给出了错误信息:

createdb: could not connect to database postgres: FATAL: Ident authentication failed for user "postgres"

如果我删除用户,它会给出与我的用户名相同的错误。我在 Centos 操作系统上。在我想出创建数据库后,我希望它能与 apache 和 php 一起工作。

当我运行 /usr/bin/postgres 时出现错误:

/usr/bin/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 environment variable.

想不通。我错过了配置步骤吗?我认为做 yum 会开箱即用。

最佳答案

听起来像是为身份验证配置的,这需要您以 linux 用户 postgres 身份登录,即:

su postgres

然后运行 ​​createdb 命令。其他方法可能是在/var/lib/pgsql/9.1/data 之类的地方找到你的 pg_hba.conf 并切换到信任身份验证。这样你就可以使用 -U postgres 与任何 linux 帐户连接,它会让你在不验证密码的情况下进入。然后您可以设置所需的用户名和密码,然后切换到更安全的方式,例如 md5。

关于database - postgresql 给出权限问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9447930/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com