Created
November 24, 2023 07:57
-
-
Save tangingw/f30951745e76e1283e5c950ba0e53278 to your computer and use it in GitHub Desktop.
Postgres Add Password
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Set up Postgres | |
[DigitalOcean Guide for Ubuntu](https://www.digitalocean.com/community/tutorials/how-to-install-and-use-postgresql-on-ubuntu-22-04) | |
# Set up Password | |
```bash | |
postgres=# select passwd from pg_shadow where usename='username'; | |
passwd | |
-------------- | |
md5... | |
postgres=# set password_encryption = 'scram-sha-256'; | |
SET | |
postgres=# alter user username with password 'secretpass'; | |
ALTER ROLE | |
postgres=# select passwd from pg_shadow where usename='username'; | |
passwd | |
-------------------------- | |
SCRAM-SHA-256$... | |
(1 row) | |
``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment