I am trying to install ApacheAGE and for this I am following the instruction in the following article but I have installed postgres 12 instead of 11. The installation was successful but when I tried to initialize DB using the command sudo ./bin/initdb demo
I am getting the following error.
initdb: error: cannot be run as root
Please log in (using, e.g., "su") as the (unprivileged) user that will
own the server process.
How do I fix the issue? Do I need to create another Linux user for this?
I am using Ubuntu 22.04. Postgresql version is 12 and is installed in the following directory /usr/lib/postgresql/12/bin
.
I created another Linux user, added that to sudoers list, logged in using su
command but I am still getting the same error.
The error code is telling you to not use sudo
before the initdb
command.
Just do ./bin/initdb demo
in that step.
I'd advise to use commands with sudo
only when it's strictly necessary.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With