我以 root 身份运行此代码:
/usr/local/bin/postgres -D /usr/local/pgsql/data
Run Code Online (Sandbox Code Playgroud)
然而它给出了这个错误;
"root" execution of the PostgreSQL server is not permitted.
The server must be started under an unprivileged user ID to prevent
possible system security compromise. See the documentation for
more information on how to properly start the server.
Run Code Online (Sandbox Code Playgroud)
如何登录 PostgreSQL?不是可以用root用户使用吗?
一些注意事项:这是 FreeBSD 10 上的 PostgreSQL 9.4(测试版,但 9.3 给了我同样的错误)。PostgreSQL 是通过 Ports 安装的。我想我有一个“pgsql”用户,因为它说
===> Registering installation for postgresql94-server-9.4.b3
===> Creating users and/or groups.
Using existing group 'pqsql'.
Using existing user 'pqsql'.
Run Code Online (Sandbox Code Playgroud)
小智 0
如果有sudo权限那么
sudo -u postgres psql
Run Code Online (Sandbox Code Playgroud)
或者使用docker postgres 如果只是root 访问 尝试
su - postgres
Run Code Online (Sandbox Code Playgroud)
然后
psql
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
18328 次 |
| 最近记录: |