首页 文章

如何在fedora postgresql中初始化initdb

提问于
浏览
1

我使用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-libs-9.3.4-1PGDG.f20.x86_64.rpm postgresql93-server-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

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

相关问题