0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

postgresql-12

Last updated at Posted at 2023-03-23


sudo yum -y install https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm

#PostgreSQLのインストール
sudo yum -y install postgresql12-server postgresql12-contrib

#PostgreSQLの初期化
sudo /usr/pgsql-12/bin/postgresql-12-setup initdb

#PostgreSQLの自動起動設定
sudo systemctl enable postgresql-12

#Postgresql.confの設定
sudo chmod 777 /var/lib/pgsql/
sudo chmod 777 /var/lib/pgsql/12/
sudo chmod 777 /var/lib/pgsql/12/data
sudo chmod 777 /var/lib/pgsql/12/data/postgresql.conf

#Postgresql.confの設定
sudo vi /var/lib/pgsql/12/data/postgresql.conf

#localhostのコメントアウトを解除する設定

pg_hba.confの設定
sudo chmod 777 /var/lib/pgsql/12/data/pg_hba.conf

pg_hba.confの設定(続き)

# "local" is for Unix domain socket connections only
local   all             all                                     trust
# IPv4 local connections:
host    all             all             127.0.0.1/32            trust
# IPv6 local connections:
host    all             all             ::1/128                 trust
# Allow replication connections from localhost, by a user with the
# replication privilege.
#local   replication     all                                     peer
#host    replication     all             127.0.0.1/32            ident
#host    replication     all             ::1/128                 ident

#アクセス権限の再設定

sudo chmod 700 /var/lib/pgsql/12/data

#PostgreSQLの再起動
sudo systemctl restart postgresql-12

#次回ユーザ設定から再開

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?