Answer the question
In order to leave comments, you need to log in
PostgreSQL role settings?
I installed Postgresql 9.6 on Debian, I want to set everything up correctly, I don’t know how, in tutorials, like in Google, they don’t give out the standard password for this user: https://www.digitalocean.com/community/tutorials/h...
Therefore, I I can't delete the test database because it asks for a password
[email protected]_serv:~$ sudo drop 'my_db_name'
We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:
#1) Respect the privacy of others.
#2) Think before you type.
#3) With great power comes great responsibility.
[sudo] password for postgres:
[email protected]_serv:~$
local all postgres peer
local all all peer
host all all 127.0.0.1/32 md5
host all all ::1/128 md5
sudo adduser sammy
Answer the question
In order to leave comments, you need to log in
sudo why?
If you are already logged in as the user under whose name the database is running (typically postgres), then administrative actions from this user are performed.
The postgres user does not have a password out of the box and this is not a security issue, because you can log in as postgres to the database only if you are already logged in as postgres to the system, and for this you need sudo or root rights.
write a command from your default user with sudo rights in the terminal.
After that, on behalf of the postgres user, run the utility
in it, you can manage databases, roles and everything else.
The commands are all from the manuals, to remove the test database, use
DROP DATABASE <dbname>;
#В конце там точка с запятой - сигнал завершения команды, а название базы пишется без кавычек или в двойных кавычках
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question