繁体   English   中英

如何在centos7上为PostgreSQL 9.2运行initdb?

[英]How to run initdb for postgresql 9.2 on centos7?

所以,

我的管理员在centos7机器上安装(不知道如何)postgresql 9.2(64位版本)。 事情是我需要初始化数据库,所以我应该运行类似的东西:

service postgresql-9.2 initdb

但我得到错误:

The service command supports only basic LSB actions (start, stop, restart, try-restart, reload, force-reload, status). For other actions, please try to use systemctl.

进行了一些搜索后,人们说您应该通过直接调用某些脚本来初始化,但是此CentOS 7机器中不存在每个给定的位置。

例如,例如以下位置(是的,它用于9.3,而我使用9.2,但是无论如何都不存在类似的位置):

/usr/lib/pgsql-9.3/bin/postgresql93-setup initdb

或这个

/usr/pgsql-9.3/bin/postgresql93-setup initdb

我发现

/usr/lib64/pgsql 

但是该目录只有一堆“ * .so”文件。

我该如何在centos7上为PostgreSQL 9.2运行initdb?

刚刚在Centos上安装了Postgresql 9.3。

#cd /etc/init.d
#ls postgres*

并且有一个posgresql-9.3脚本

#./postgresql-9.3 

提供给您运行的选项,其中之一是initdb

您可以直接从postgres帐户运行它

#su - postgres -c pg_ctl initdb

暂无
暂无

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

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