Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to Change User Password in PostgreSQL
#1


    How to Change User Password in PostgreSQL

   

Changing the default postgres role password is essential to improve database security. Here’s how to do it:


   

Activate the PostgreSQL prompt using this command:


   
sudo -u postgres psql

   

Run this statement to change the postgres account password. Don’t forget to replace NewPassword with your actual password:


   
ALTER USER postgres PASSWORD 'NewPassword';

   

Check whether the change is applied successfully using the following command:


   
\p

   

Restart the PostgreSQL service using this command:


   
sudo service postgresql restart
   

   

   

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)