新聞中心
一、yum安裝pgsql10
二、
一、yum安裝pgsql10
- 先安裝pgsql
環(huán)境centos 7 64位
數(shù)據(jù)庫:pg10dev
參考網(wǎng)址:
http://blog.csdn.net/silenceray/article/details/70577610
創(chuàng)建用戶
[root@localhost ~]#useradd postgres
配置你的yum存儲庫
[root@localhost ~]# vim /etc/yum.repos.d/CentOS-Base.repo
[base] 和[updates] 區(qū)段之間添加:
exclude=postgresql*
安裝pg的rpm文件
[root@localhost ~]# yum localinstall https://download.postgresql.org/pub/repos/yum/testing/10/redhat/rhel-7-x86_64/pgdg-centos10-10-1.noarch.rpm
安裝pg數(shù)據(jù)庫
[root@localhost ~]# yum list postgresql*
[root@localhost ~]# yum install postgresql10-server.x86_64
[root@localhost ~]# mkdir postgres /var/lib/pgsql/10/data
初始化數(shù)據(jù)庫
[root@localhost ~]# /usr/pgsql-10/bin/postgresql10-setup initdb
Initializing database ... OK
[root@localhost ~]# su - postgres
[postgres@localhost ~]$ /usr/pgsql-10/bin/pg_ctl -D /var/lib/pgsql/10/data start
[postgres@localhost ~]$ /usr/pgsql-10/bin/psql -p 5432
psql (10devel)
輸入 "help" 來獲取幫助信息.
postgres=#
安裝完成!
- 配置pgsql,使客戶端能訪問
2.1 改密碼
(1)su postgres
(2) psql -U postgres -p5433
(3)alter user postgres with password 'postgres' ;
2.2 修改配置文件,允許遠程登陸。
和pg_hba.conf一個目錄下的,postgresql.conf,
listen_addresses = 'localhost' ,改成listen_addresses = '*'
2.3 修改端口
另外有需要云服務(wù)器可以了解下創(chuàng)新互聯(lián)cdcxhl.cn,海內(nèi)外云服務(wù)器15元起步,三天無理由+7*72小時售后在線,公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國服務(wù)器、虛擬主機、免備案服務(wù)器”等云主機租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡單易用、服務(wù)可用性高、性價比高”等特點與優(yōu)勢,專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應(yīng)用場景需求。
網(wǎng)站名稱:測試postgresql集群-創(chuàng)新互聯(lián)
本文路徑:http://www.dlmjj.cn/article/eggii.html