# postgres psql
"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.
## You cannot be root to use these commands, so su to postgres user
# su - postgres
## Create user named "testing"
postgres@f8087f90456e:~$ createuser testing
## Create database named "testing"
postgres@f8087f90456e:~$ createdb testing
## Create password "secretpassword" for user testing.
postgres@f8087f90456e:~$ psql -c "alter user miniflux with encrypted password 'secretpassword';"
ALTER ROLE
## Grant permissions to database testing to user testing
postgres@f8087f90456e:~$ psql -c "grant all privileges on database testing to testing;"
GRANT
## Test it out
postgres@f8087f90456e:~$ psql --host=localhost --dbname=testing --username=testing
psql (14.11 (Debian 14.11-1.pgdg120+2))
Type "help" for help.
testing=>
Like this:
Like Loading...
Related