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
2d2 replies
Santiago Roberts
4d