您的位置:首页 > 运维架构 > Linux

CentOS 7.2 安装PostgreSQL 9.5.2

2016-08-06 19:48 357 查看
1. 配置Yum源:

yum install http://yum.postgresql.org/9.5/redhat/rhel-7.2-x86_64/pgdg-centos95-9.5-2.noarch.rpm
2. 安装

yum install postgresql95-server postgresql95-contrib

3. 初始化数据库

/usr/pgsql-9.5/bin/postgresql95-setup initdb

4. 启动服务并设置为开机启动

systemctl enable postgresql-9.5

systemctl start postgresql-9.5

5. 允许远程访问

vi /var/lib/pgsql/9.5/data/pg_hba.conf           修改:host    all             all             192.168.1.1/24         md5

vi /var/lib/pgsql/9.5/data/postgresql.conf      修改:listen_addresses = '*'        
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: