溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點(diǎn)擊 登錄注冊 即表示同意《億速云用戶服務(wù)條款》

postgreSQL二進(jìn)制快速安裝

發(fā)布時間:2020-04-08 00:52:05 來源:網(wǎng)絡(luò) 閱讀:1563 作者:wjw555 欄目:MySQL數(shù)據(jù)庫

二進(jìn)制安裝步驟:

groupadd postgres

 useradd -g postgres postgres

 id postgres

 passwd postgres

 mkdir -p /data/postgresql/data 

 mkdir -p /data/postgresql/log

 tar xf postgresql-9.5.9-1-linux-x64-binaries.tar.gz -C /usr/local/

 cd /usr/local/

 chown -R postgres.postgres pgsql

 cd /data

 chown -R postgres.postgres postgresql

 cd /usr/local/pgsql/bin/

 vim /etc/profile

 source /etc/profile


普通用戶啟動postgreSQL服務(wù)

 su - postgres

初始化數(shù)據(jù)庫:

 initdb -E utf8 -D /data/postgresql/data

啟動數(shù)據(jù)庫:

 pg_ctl -D /data/postgresql/data -l /data/postgresql/log/postgres.log start

[root@localhost log]# tailf /data/postgresql/log/postgres.log 

LOG:  could not create IPv6 socket: Address family not supported by protocol

LOG:  database system was shut down at 2017-10-04 18:06:18 CST

LOG:  MultiXact member wraparound protections are now enabled

LOG:  database system is ready to accept connections

LOG:  autovacuum launcher started

關(guān)閉postgresql服務(wù)

pg_ctl -D /data/postgresql/data -l /data/postgresql/log/postgres.log stop

[root@localhost log]# tailf /data/postgresql/log/postgres.log 

LOG:  received fast shutdown request

LOG:  aborting any active transactions

LOG:  autovacuum launcher shutting down

LOG:  shutting down

LOG:  database system is shut down

重啟postgresql服務(wù)

pg_ctl -D /data/postgresql/data -l /data/postgresql/log/postgres.log restart

[root@localhost log]# tailf /data/postgresql/log/postgres.log 

LOG:  received fast shutdown request

LOG:  aborting any active transactions

LOG:  autovacuum launcher shutting down

LOG:  autovacuum launcher shutting down

LOG:  shutting down

LOG:  database system is shut down

LOG:  could not create IPv6 socket: Address family not supported by protocol

LOG:  database system was shut down at 2017-10-04 18:08:15 CST

LOG:  MultiXact member wraparound protections are now enabled

LOG:  database system is ready to accept connections

LOG:  autovacuum launcher started

查看啟動日志:

 tail -100f /data/postgresql/log/postgres.log

ps -ef

登陸數(shù)據(jù)庫:

 psql

默認(rèn)登陸postgresql數(shù)據(jù)庫是不需要密碼的

向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報,并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI