微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

CentOS 7安装Postgresql

原文链接http://www.cnblogs.com/sycamore/p/5400959.html
1 yum install http://yum.postgresql.org/9.4/redhat/rhel-6-x86_64/pgdg-redhat94-9.4-1.noarch.rpm
2 yum install postgresql94-server postgresql94-contrib
3 /usr/pgsql-9.4/bin/postgresql94-setup initdb
开机启动
1 systemctl enable postgresql-9.4.service
启动postgresql
1 systemctl start postgresql-9.4.service
远程访问 允许所有IP访问
vi /var/lib/pgsql/9.4/data/postgresql.conf
listen_addresses ='*'

vi /var/lib/pgsql/9.4/data/pg_hba.conf
host    all    all    0.0.0.0/0    md5
修改密码
1 su postgres
2 psql -U postgres
3 ALTER USER postgres WITH PASSWORD 'yourpassword'
如果有防火墙,关掉或者加上
vi /usr/lib/firewalld/services/postgres94.xml
<?xml version="1.0" encoding="utf-8"?>
<service>
        <short>Postgres 9.4 Database service</short>
        <description>Postgres</description>
        <portprotocol="tcp"port="5432"/>
</service>

firewall-cmd --permanent --add-service=postgres94
firewall-cmd --reload
在windows上可以用pgAdmin连接管理。
 

转载于:https://www.cnblogs.com/sycamore/p/5400959.html

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

相关推荐