“Postgres Passwort vergessen” Code-Antworten

Wie man das vergessene PostgreSQL -Passwort zurückgesetzt wird

# 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
Smiling Snake

Postgres Passwort Windows zurücksetzen

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.
David Diamant

Vergessen das Passwort, das ich während der Postgres -Installation eingegeben habe

What I did to resolve the same problem was:

Open pg_hba.conf file with gedit editor from the terminal:

sudo gedit /etc/postgresql/9.5/main/pg_hba.conf
It will ask for password. Enter your admin login password. This will open gedit with the file. Paste the following line:

host  all   all  127.0.0.1/32  trust
just below -

# Database administrative login by Unix domain socket
Save and close it. Close the terminal and open it again and run this command:

psql -U postgres
You will now enter the psql console. Now change the password by entering this:

ALTER USER [your prefered user name] with password '[desired password]';
If it says user does not exist then instead of ALTER use CREATE.

Lastly, remove that certain line you pasted in pg_hba and save it.

Old-fashioned Ostrich

postgre Passwort zurücksetzen

$ sudo -u postgres psql

Then type

# ALTER USER my_user_name with password 'my_secure_password';
Tanishq Vyas

So setzen Sie das Postgres -Passwort zurück

sudo sed -ibak 's/^\([^#]*\)md5/\1trust/g' /opt/bitnami/postgresql/conf/pg_hba.conf
sudo -u postgres pg_ctl reload
Itchy Ibis

Postgres Passwort vergessen

psql -U postgres
Davidosky

Ähnliche Antworten wie “Postgres Passwort vergessen”

Fragen ähnlich wie “Postgres Passwort vergessen”

Weitere verwandte Antworten zu “Postgres Passwort vergessen” auf Sql

Durchsuchen Sie beliebte Code-Antworten nach Sprache

Durchsuchen Sie andere Codesprachen