安装以及启动
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
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。