Modify postgresql account password under linux

Modify postgresql account password under linux

To change the PostgreSQL account password under Linux, you can follow the steps below:

  1. Open a terminal and log in to the Linux system as administrator.
  2. Log in to the PostgreSQL database as administrator using the following command:
sudo -u postgres psql
  1. Enter your administrator password to continue.

  2. In the PostgreSQL command line interface, use the following command to change the account password: replace username with the name of the account whose password you want to change, and replace new_password with the new password.

ALTER USER username WITH PASSWORD 'new_password';
  1. After executing the above command, the account password will be modified. If you need to change the password of other accounts, repeat step 4.

  2. To exit the PostgreSQL command line interface, use the following command:

\q
  1. Exit the terminal.
  2. OVER Now, you have successfully changed the password of your PostgreSQL account. Please make sure you remember your new password so you can use it the next time you log in.

Guess you like

Origin blog.csdn.net/qq_37959253/article/details/132919518