Note that using the ALTER ROLE statement will transfer the password to the server in cleartext. In addition, the cleartext password may be logged in the psql’s command history or the server log. In this tutorial, you have learned how to change the password of a PostgreSQL user using the ALTER ROLE statement. Backup the pghba.conf file by copying it to a different location or just rename it to.
NOTE: We are in the process of modifying the file structure and configuration for many Bitnami stacks. On account of these changes, the file paths stated in this guide may change depending on whether your Bitnami stack uses native Linux system packages (Approach A), or if it is a self-contained installation (Approach B). To identify your Bitnami installation type and what approach to follow, run the command below:
The output of the command indicates which approach (A or B) is used by the installation, and will allow you to identify the paths, configuration and commands to use in this guide. Refer to the FAQ for more information on these changes.
Change the PostgreSQL password
You can modify the PostgreSQL password using the following command at the shell prompt:
Reset the PostgreSQL password
If you don’t remember your PostgreSQL database password, you can follow the steps below to reset it to a new value:
Change the authentication method in the PostgreSQL configuration file pg_hba.conf from md5 to trust and reload the configuration.
Approach A (Bitnami installations using system packages):
Android emulator for macos catalina. Approach B (Self-contained Bitnami installations):
Connect to the PostgreSQL database and set the password to a new value:
Finally, change the authentication method back to md5 and reload the old PostgreSQL configuration:
Approach A (Bitnami installations using system packages):
Approach B (Self-contained Bitnami installations):
Postgresql For Mac
You should now be able to connect to PostgreSQL with the new password.