久久久精品一区ed2k-女人被男人叉到高潮的视频-中文字幕乱码一区久久麻豆樱花-俄罗斯熟妇真实视频

linux安裝postgresql的方法-創(chuàng)新互聯(lián)

創(chuàng)新互聯(lián)www.cdcxhl.cn八線動(dòng)態(tài)BGP香港云服務(wù)器提供商,新人活動(dòng)買多久送多久,劃算不套路!

專注于為中小企業(yè)提供成都網(wǎng)站建設(shè)、網(wǎng)站建設(shè)服務(wù),電腦端+手機(jī)端+微信端的三站合一,更高效的管理,為中小企業(yè)望花免費(fèi)做網(wǎng)站提供優(yōu)質(zhì)的服務(wù)。我們立足成都,凝聚了一批互聯(lián)網(wǎng)行業(yè)人才,有力地推動(dòng)了上千家企業(yè)的穩(wěn)健成長(zhǎng),幫助中小企業(yè)通過(guò)網(wǎng)站建設(shè)實(shí)現(xiàn)規(guī)模擴(kuò)充和轉(zhuǎn)變。

小編給大家分享一下linux安裝postgresql的方法,希望大家閱讀完這篇文章后大所收獲,下面讓我們一起去探討吧!

linux安裝postgresql

配置用戶和組

groupadd postgres
useradd postgres -g postgres

環(huán)境準(zhǔn)備

yum install -y perl-ExtUtils-Embed readline-devel zlib-devel pam-devel libxml2-devel libxslt-devel 
openldap-devel 
 python-devel gcc-c++ openssl-devel cmake gcc* readline-devel

權(quán)限配置

mkdir /opt/postgres
chown -R postgres:postgres /opt/postgres/

配置環(huán)境變量

vi /etc/profile

#在文件末尾將以下環(huán)境變量添加進(jìn)去
export PATH=/opt/postgres/bin:$PATH
export PGHOME=/opt/postgres
export PGDATA=/opt/postgres/data/
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PGHOME/lib/
export PATH=$PGHOME/bin:$PATH:$HOME/bin

安裝過(guò)程

安裝數(shù)據(jù)庫(kù)

cd 下載好的壓縮包存放路徑#解壓文件tar -zxvf postgresql-9.6.3.tar.gz

cd  postgresql-9.6.3#參數(shù)根據(jù)自己需求配置./configure --prefix=/opt/postgres/ --with-python --with-libxml 
--with-libxslt
make
make install****,安裝過(guò)程內(nèi)容太長(zhǎng)就不截圖了,從屏顯的信息最后看到PostgreSQL installation complete. 就說(shuō)明安裝好了,
如果報(bào)錯(cuò)大多數(shù)都是安裝包問(wèn)題或者依賴沒下載,看下錯(cuò)誤信息基本都能解決****

2.初始化數(shù)據(jù)庫(kù)

su postgres

#初始化數(shù)據(jù)庫(kù)的參數(shù)也是根據(jù)自己需要添加 ,可以通過(guò)--help查看
/opt/postgres/bin/initdb -D $PGDATA  -E  UTF8  

#如果出現(xiàn)以下message就說(shuō)明初始化成功了
*********************************************************************

    creating directory /opt/postgres/data ... ok
    creating subdirectories ... ok
    selecting default max_connections ... 100
    selecting default shared_buffers ... 128MB
    selecting dynamic shared memory implementation ... posix
    creating configuration files ... ok
    running bootstrap script ... ok
    performing post-bootstrap initialization ... ok
    syncing data to disk ... ok
    
    WARNING: enabling "trust" authentication for local connections
    You can change this by editing pg_hba.conf or using the option -A, or
    --auth-local and --auth-host, the next time you run initdb.
    
    Success. You can now start the database server using:
    
        /opt/postgres/bin/pg_ctl -D /opt/postgres/data -l logfile start
    
********************************************************************
#啟動(dòng)數(shù)據(jù)庫(kù)服務(wù)

#數(shù)據(jù)文件和日志文件的路徑根據(jù)自己需求指定。
/opt/postgres/bin/pg_ctl -D $PGDATA -l /opt/postgres/server.log start

到此postgres服務(wù)就安裝完畢了。

使用數(shù)據(jù)庫(kù)

進(jìn)入數(shù)據(jù)庫(kù)

su postgres

#進(jìn)入數(shù)據(jù)庫(kù)

[postgres@localhost postgres]$ psql
psql (9.6.3)
Type "help" for help.

postgres=#

修改數(shù)據(jù)庫(kù)配置,允許其他服務(wù)器連接

#postgres安裝好以后需要修改2個(gè)配置文件才能允許別的服務(wù)器訪問(wèn)。
cd /opt/postgres/data

vi postgresql.conf
#找到listen_addresses和port參數(shù),修改如下,也可根據(jù)自己需求修改
listen_addresses = '*'
port = 5432

#根據(jù)自己的網(wǎng)段設(shè)置下放行的ip規(guī)則
vi pg_hba.conf

# IPv4 local connections:
host    all             all             192.168.0.0/16            md5

看完了這篇文章,相信你對(duì)linux安裝postgresql的方法有了一定的了解,想了解更多相關(guān)知識(shí),歡迎關(guān)注創(chuàng)新互聯(lián)-成都網(wǎng)站建設(shè)公司行業(yè)資訊頻道,感謝各位的閱讀!

分享題目:linux安裝postgresql的方法-創(chuàng)新互聯(lián)
本文地址:http://sd-ha.com/article48/shjhp.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供全網(wǎng)營(yíng)銷推廣、網(wǎng)站維護(hù)、網(wǎng)站設(shè)計(jì)公司、網(wǎng)站建設(shè)企業(yè)網(wǎng)站制作云服務(wù)器

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)

外貿(mào)網(wǎng)站建設(shè)