首页 > 其他 > 详细

postgres服务

时间:2019-10-09 18:48:16      阅读:96      评论:0      收藏:0      [点我收藏+]

安装以及启动

yum install readline-devel
tar xf postgresql-11.1.tar.gz
cd postgresql-11.1
./configure --prefix=/data/postgresql
make && make install
# useradd postgres
# groupadd postgres
mkdir /data/postgresql/data
chown postgres.postgres /data/postgresql/data
su - postgres

#数据库初始化
/data/postgresql/bin/initdb -D /data/postgresql/data
#配置允许ip访问
vim /data/postgresql/data/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
host    all             all             192.168.137.3/24        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                                     trust
host    replication     all             127.0.0.1/32            trust
host    replication     all             ::1/128                 trust
host    all             all              *                      md5

 #修改监听地址和连接端口

  vim /data/postgresql/data/postgresql.conf 

listen_addresses = *
port = 5432 

#启动(以postgres用户启动)

/data/postgresql/bin/pg_ctl -D /data/postgresql/data -l /data/postgresql/data/logfile start

#重新加载配置
/data/postgresql/bin/pg_ctl -D /data/postgresql/data reload

 

postgres服务

原文:https://www.cnblogs.com/mmyy-blog/p/11643357.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!