我正在尝试将PostgreSQL设置到CentOS (通过SSH连接)。我需要解压缩一个包(所以不要通过yum或rpm下载):http://get.enterprisedb.com/postgresql/postgresql-9.3.4-3-linux-x64-binaries.tar.gz并设置这个包。
我解压缩,然后运行以下命令
./postgresql-9.3/bin/initdb -D data/
./postgresql-9.3/bin/postgres -D data/当我试图运行./postgresql-9.3/bin/psql或createuser时,有人要求我输入密码,但是get:psql.bin: FATAL: password authentication failed for user "myusername"
问:我如何使psql和createuser工作?
更多信息
我的./data/pg-hba.conf如下:
local all all trust
host all all 127.0.0.1/32 trust
host all all ::1/128 trust而且,系统中似乎没有postgres用户,这是有意义的,因为我只是解压缩tar.gz
发布于 2014-08-27 16:21:39
您应该以管理用户的身份发出psql命令,这是默认的postgres:sudo -u postgres psql postgres。
(假设您将postgres目录添加到path或sudo -u postgres ./postgresql-9.3/bin/psql postgres中)
一旦您在psql控制台,\password postgres并输入您的新密码
https://serverfault.com/questions/624475
复制相似问题