When running bin/initdb demo
I encounter the following error:
The files belonging to this database system will be owned by user "USER_1".
This user must also own the server process.
The database cluster will be initialized with locales
COLLATE: en_US.UTF-8
CTYPE: en_US.UTF-8
MESSAGES: en_US.UTF-8
MONETARY: ur_PK
NUMERIC: ur_PK
TIME: ur_PK
The default database encoding has accordingly been set to "UTF8".
The default text search configuration will be set to "english".
Data page checksums are disabled.
creating directory newDB ... initdb: error: could not create directory "newDB": Permission denied
Running it as root gives me this 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.
What could be the problem here, would appreciate any help.