pg_ctl: cannot be run as root

来源:互联网 发布:用电脑修改游戏数据 编辑:程序博客网 时间:2024/04/29 23:37

使用pg_ctl管理postgresql数据库报错:

[root@db1 Desktop]# pg_ctl startpg_ctl: cannot be run as rootPlease log in (using, e.g., "su") as the (unprivileged) user that willown the server process.

原因是用户错误的使用了root用户来执行命令。

PG是禁止使用超级管理员来运行该命令的。

切换到操作系统数据库管理员用户下运行命令。
[root@db1 Desktop]# su - highgo[highgo@db1 ~]$ pg_ctl start

By 徐云鹤