xxxxxxxxxx
# if you are getting this auth error then
# please check if psql is using the password for correct user
# for ex, if you are trying to enter as the default user, which
# is 'postgres' then type this
psql -U postgres
# you will be promted for password,enter it
xxxxxxxxxx
$ sudo -u postgres psql
Then type
# ALTER USER my_user_name with password 'my_secure_password';
xxxxxxxxxx
# sudo -u postgres psql
could not change directory to "/root"
psql (9.1.11)
Type "help" for help.
postgres=# \password
Enter new password:
Enter it again:
postgres=# \q
xxxxxxxxxx
In command prompt:
> psql -U postgres(postgres is my username)
> <Type in your current password>
> \password postgres
xxxxxxxxxx
In any PostgreSQL Query editor just type this
ALTER USER postgres WITH PASSWORD 'new_password';
xxxxxxxxxx
Backup the pg_hba.conf file by copying it.
Edit the pg_dba.conf, change `METHOD` to 'trust'
Restart the PostgreSQL server.
psql -U postgres.
ALTER USER postgres WITH PASSWORD 'new_password';
Restore the pg_dba.conf file.
Restart the PostgreSQL server.
xxxxxxxxxx
sudo sed -ibak 's/^\([^#]*\)md5/\1trust/g' /opt/bitnami/postgresql/conf/pg_hba.conf
sudo -u postgres pg_ctl reload
xxxxxxxxxx
pg_ctl -D "C:\Program Files\PostgreSQL\12\data" restart
Langage de code : JavaScript ( javascript )