I would like to share this kind commands and scripts because this is very common and day to day exercise for a Database Administrator.
In the PostgreSQL, we have also one pg_hba.conf file.
pg_hba.conf is a configuration file which is controlled Client Authentication.
This file automatically installed when the data directory is initialized.
If you want to login without password, you can put “peer” or “trust” instead of md5 in this file.
like,
local all postgres peer
But for the security purpose, we should put md5.
Change database password using ALTER:
First login:sudo -u user_name psql database_nameALTER Command:ALTER USER user_name WITH PASSWORD 'MyNew_Password';Change database password using \password:First login:root=# sudo -u user_name psql database_nameUsing \password:root=# \password user_name Enter new password: ***Enter it again: ***
0 comments:
Post a Comment