PostgrSQL + Rocky

1 설치

sudo dnf update

dnf module list postgresql
sudo dnf module reset postgresql
sudo dnf module enable postgresql:12
sudo dnf install postgresql-server postgresql
// sudo /usr/pgsql-16/bin/postgresql-16-setup initdb
sudo postgresql-setup --initdb
sudo systemctl start postgresql
sudo systemctl enable postgresql

2 컨트롤

[root@linux]# passwd postgres

// login 
 
[root@localhost itcamp.org]# sudo -u postgres psql
psql (12.12)
Type "help" for help.

postgres=# create user jeff with password 'asdfasdf';
CREATE ROLE
postgres=# create database itcamp_db;
CREATE DATABASE
postgres=# grant all privileges on database itcamp_db to jeff;
GRANT
postgres=# \l
                                  List of databases
   Name    |  Owner   | Encoding |   Collate   |    Ctype    |   Access privileges   
-----------+----------+----------+-------------+-------------+-----------------------
 itcamp_db | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =Tc/postgres         +
           |          |          |             |             | postgres=CTc/postgres+
           |          |          |             |             | jeff=CTc/postgres
 postgres  | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | 
 template0 | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =c/postgres          +
           |          |          |             |             | postgres=CTc/postgres
 template1 | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =c/postgres          +
           |          |          |             |             | postgres=CTc/postgres
 user      | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | 
(5 rows)

설정파일 찾기

sudo find / -name pg_hba.conf
2 Comments
Jordan Singer
2d
Lorem ipsum, dolor sit amet consectetur adipisicing elit. Non minima ipsum at amet doloremque qui magni, placeat deserunt pariatur itaque laudantium impedit aliquam eligendi repellendus excepturi quibusdam nobis esse accusantium.
2 replies
Brandon Smith
2d
Lorem ipsum dolor sit, amet consectetur adipisicing elit.
James Parsons
1d
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Distinctio dolore sed eos sapiente, praesentium.
Santiago Roberts
4d
Lorem ipsum dolor sit amet consectetur adipisicing elit. Iusto laborum in corrupti dolorum, quas delectus nobis porro accusantium molestias sequi.