PostgreSQL : Update Password

 1. 신규 유저 생성


[root@localhost] sudo -i -u postgres

[sudo] password for parallels: {password}

postgres@localhost:~$ psql
psql (14.8 (Ubuntu 14.8-0ubuntu0.22.04.1))
Type "help" for help.

postgres=# create user {user_name} password '{user_password}' superuser;
CREATE ROLE
postgres=# \du
                                   List of roles
 Role name |                         Attributes                         | Member of 
-----------+------------------------------------------------------------+-----------
 postgres  | Superuser, Create role, Create DB, Replication, Bypass RLS | {}
 symfony   | Superuser                                                  | {}

postgres=# \q


2. 비밀번호 변경

[root@localhost] sudo -i -u postgres

[sudo] password for parallels: {password}

postgres@localhost:~$ psql
psql (14.8 (Ubuntu 14.8-0ubuntu0.22.04.1))
Type "help" for help.

postgres=# alter user {username} password '{user_password}'

postgres=# \q


3. 환경설정 확인

[root@localhost] sudo cat /etc/postgresql/14/main/postgresql.conf | grep -i listen_addresses


 

이 블로그의 인기 게시물