如何在fedora postgresql中初始化initdb

时间:2014-12-11 07:18:58

标签: postgresql fedora

我使用rpm包在fedora 20上安装了postgresql。我手动下载了postgres所需的软件包,这些软件包如下:

  

libxslt-1.1.28-5.fc20.x86_64.rpm postgresql-9.3.1-2.fc20.x86_64.rpm   postgresql93-9.3.4-1PGDG.f20.x86_64.rpm   postgresql93-的contrib-9.3.4-1PGDG.f20.x86_64.rpm   postgresql93-库,9.3.4-1PGDG.f20.x86_64.rpm   postgresql93服务器,9.3.4-1PGDG.f20.x86_64.rpm   postgresql-libs-9.3.1-2.fc20.x86_64.rpm uuid-1.6.2-26.el7.x86_64.rpm

我安装了这样的软件包。

[root@fedorarpmpostgres ~]# rpm -ivh libxslt-1.1.28-5.fc20.x86_64.rpm 

输出

Preparing...                          ################################# [100%]

    package libxslt-1.1.28-5.fc20.x86_64 is already installed

so its already installed ok now i'm successfull in stalling all this packages. now how can i 
install initdb

i  tried like this way but i got this error.

[root@fedorarpmpostgres ~]# /usr/pgsql-9.3/bin/initdb --encoding=UTF8 --

输出:

pgdata=/var/lib/pgsql/9.3/data/

initdb: cannot be run as root


Please log in (using, e.g., "su") as the (unprivileged) user that will
own the server process.

我告诉你的一件事是我通过yum安装postgres是成功的但我需要通过rpm安装postgres,就像我上面那样做

任何正文都可以帮助我初始化initdb。

感谢。

1 个答案:

答案 0 :(得分:0)

使用root用户,如果您没有设置postgres用户密码(默认情况下未设置),请执行su postgres,您应该可以执行initdb。