Postgresql不合作。我做了一大堆postgresql和postgresql-server,这似乎很好。我然后试着``,它给出和错误信息:postgresql提供权限问题
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.
不能弄明白。我错过了配置步骤吗?我认为做百胜餐饮可以起到作用。
因此,我编辑了pg_hba.conf以包含在文件末尾:'host all all 127.0.0.1/32 trust'。然后我尝试重新启动服务器,但它说'pg_ctl:没有指定数据库目录,环境变量PGDATA未设置' – user983223 2012-02-25 21:15:03
你说的是成为postgres然后创建用户是正确的。我的问题是我没有想到我有一个名为postres的用户。我通过成为root然后成为postgres然后createuser创建我想要的用户来解决问题 – user983223 2012-02-25 21:31:36
将下列内容添加到.profile或.bash_profile中以解决数据目录问题:export PGDATA =/Library/PostgreSQL/9.2/data/' – Tom 2013-06-05 01:25:10