How do I change a user's password in Postgresql (using PgAdmin) so that I can connect with Rails to the Postgres database using these credentials?
So far: In PgAdmin I right clicked the database name, clicked Create Script and then typed the command:
CREATE USER usr1 WITH PASSWORD 'pwd1!@#$';
Question: where exactly in PgAdmin am I able to see the user and password or list of users and passwords? So far I am unable to see this in Db properties --> 'privileges'?? Any tips on other security elements? or something that can be improved in my current methods? Thanks a lot.
Run the query from pgadmin:
SELECT rolname, rolpassword FROM pg_authid;
This requires superuser privileges to protect the password.
In the file "pgpass.conf" in this path:
C:\Users\[User's name]\AppData\Roaming\postgresql
Login roles are common for all databases in a server. You can see them in the bottom of the object browser (left panel). To execute arbitrary SQL query open Query tool (Ctrl-E) from Tools in main menu or click on icon with 'SQL' (previously you have to select a database). To change user password execute SQL:
ALTER ROLE username PASSWORD 'newpassword'
ALTER USER
is an alias for ALTER ROLE
. Read about it in documentation.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With