简体   繁体   English

如何在Fedora PostgreSQL中初始化initdb

[英]How to initialize initdb in fedora postgresql

I was installed postgresql on fedora 20 using rpm packages. 我使用rpm软件包在fedora 20上安装了postgresql。 i was manually downloaded the packages which were required for postgres those packages are as follows: 我手动下载了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 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

and i was installed those packages like this. 我安装了像这样的软件包。

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

Output 产量

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 --

Output: 输出:

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.

one thing i was to inform you is i'm success in installing postgres through yum but i need postgres installation through rpm only like the way i did above 我要通知您的一件事是,我通过yum成功安装了postgres,但是我只需要像上面的方法那样通过rpm安装postgres

could any body help me how to initialize initdb. 任何机构都可以帮助我如何初始化initdb。

Thanks. 谢谢。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM