所以,
我的管理员在centos7机器上安装(不知道如何)PostgreSQL9.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上运行PostgreSQL9.2的initdb?
发布于 2014-09-26 20:39:02
您可以直接从postgres帐户运行它
#su - postgres -c pg_ctl initdb发布于 2014-09-04 03:30:57
刚在Centos上安装了Postgresql 9.3。
#cd /etc/init.d
#ls postgres*这里有一个posgresql-9.3脚本
#./postgresql-9.3 为您提供运行选项,其中之一是initdb
https://stackoverflow.com/questions/25648294
复制相似问题