I can’t access my postgresql datatabase because I forgot my password for PostgresSQL super user. What do I need to do?
I must enter pass when try to uninstall PostgresSQL or open psql database in terminal.
I can’t access my postgresql datatabase because I forgot my password for PostgresSQL super user. What do I need to do?
I must enter pass when try to uninstall PostgresSQL or open psql database in terminal.
2
Answers
this is solved... thank u so much for all help
First of all switch to PostgreSQL user by running this command on your terminal.
Now you have logged in as postgreSQL user. The next thing to do now is to access postgreSQL prompt. You can do this without using your password.Run this command;
Now reset your password using this command. Write your new password in the placeholder ‘new-password’.Don’t remove quotes around the new password.
Now exit the postgreSQL prompt by using this command
You have to exit from the postgreSQL user shell as well. Use this command;
At last run this command to restart your postgreSQL service.
Hope it works to solve your issue 🙂