赞
踩
https://www.cnblogs.com/freeweb/p/8006639.html
https://www.enterprisedb.com/download-postgresql-binaries
https://www.postgresql.org/download/linux/redhat/
https://www.postgresql.org/download/linux/redhat/
# yum install https://download.postgresql.org/pub/repos/yum/9.5/redhat/rhel-7-x86_64/pgdg-redhat95-9.5-3.noarch.rpm
# ll /etc/yum.repos.d/
-rw-r--r-- 1 root root 482 Jan 5 2016 pgdg-95-redhat.repo
# yum install postgresql95
# yum install postgresql95-server
# systemctl enable postgresql-9.5
# systemctl start postgresql-9.5
# systemctl status postgresql-9.5.service
● postgresql-9.5.service - PostgreSQL 9.5 database server
Loaded: loaded (/usr/lib/systemd/system/postgresql-9.5.service; enabled; vendor preset: disabled)
Active: active (running) since Wed 2018-04-18 07:40:03 EDT; 52s ago
*****************
# /usr/pgsql-9.5/bin/postgresql95-setup initdb
Initializing database ... OK
参考:https://help.ubuntu.com/stable/serverguide/postgresql.html
# su - postgres
-bash-4.2$ psql -U postgres
postgres=# \? -- 查看帮助
postgres=# ALTER USER postgres WITH PASSWORD '1234' --修改postgres用户的密码
postgres-# \q --退出修改
# vi /var/lib/pgsql/9.5/data/postgresql.conf
******
listen_addresses = '*' # what IP address(es) to listen on;
修改成以下配置
# vi /var/lib/pgsql/9.5/data/pg_hba.conf
***********
# IPv4 local connections:
host all all 127.0.0.1/32 md5
host all all ::/32 md5
local replication postgres md5
# systemctl stop firewalld
# systemctl disable firewalld
# systemctl restart postgresql-9.5.service
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。