/usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data \ 报错 initdb: error: cannot be run as roo
时间: 2023-09-01 12:13:06 浏览: 181
PostgreSQL14离线安装包,适配CentOS7/RedHat7
As an AI language model, I cannot access your system, but the error message "initdb: error: cannot be run as root" indicates that you are trying to run the "initdb" command as the root user, which is not allowed.
To fix this issue, you can create a new user with appropriate permissions to run the "initdb" command or switch to a non-root user before running the command.
You can create a new user with the following command:
```
sudo adduser postgres
```
Then, switch to the postgres user by running:
```
sudo su - postgres
```
After that, you can run the "initdb" command without any issues.
阅读全文