Postgres server error on mac ["root" execution of the PostgreSQL server is not permitted. The server must be started under an unprivileged user ID]

Viewed 640

Anyone to help me solve this issue that has been on my case for the last couple of hours? I have so far tried all suggested solutions but can't seem to find anything working.

Error:

"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.

I will forever be grateful to anyone who helps me solve this.

1 Answers

Try, change you user in postgres

Switching Over to the postgres Account Switch over to the postgres account on your server by typing: sudo -i -u postgres You can now access a Postgres prompt immediately by typing: psql This will log you into the PostgreSQL prompt, and from here you are free to interact with the database management system right away. Exit out of the PostgreSQL prompt by typing: \q This will bring you back to the postgres Linux command prompt. Accessing a Postgres Prompt Without Switching Accounts You can also run the command you’d like with the postgres account directly with sudo. For instance, in the last example, you were instructed to get to the Postgres prompt by first switching to the postgres user and then running psql to open the Postgres prompt. You could do this in one step by running the single command psql as the postgres user with sudo, like this: sudo -u postgres psql This will log you directly into Postgres without the intermediary bash shell in between. Again, you can exit the interactive Postgres session by typing: \q Many use cases require more than one Postgres role. Read on to learn how to configure these.

Related