linux的pg数据库启动时报错:No such file or directory

刚刚接触linux。项目下linux中安装了pg数据库,结果想单独启动pg数据时报错。
在使用以下脚本启动linux中安装的pg数据库时出现错误。

[xxx@linux-centos7 bin]$ ./pg_ctl -D xxx/xxx/PostgreSQL/9.2/data

出现的错误:
postgres cannot access the server configuration file “xxx /PostgreSQL/9.2/data/postgresql.conf”: No such file or directory。

具体原因:
似乎是由于 启动的语句有问题。不能使用该路径来启动pg数据库。

解决办法:
使用以下语句来启动。

[xxx@linux-centos7 bin]$ ./pg_ctl -D ../data start

其中bin为postgres安装目录中的bin目录。

猜你喜欢

转载自blog.csdn.net/qq_34484062/article/details/89639131