postgreSQL二進位快速安裝

來源:互聯網
上載者:User

標籤:postgresql二進位快速安裝

二進位安裝步驟:

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服務

 su - postgres

初始化資料庫:

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

啟動資料庫:

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

[[email protected] 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

關閉postgresql服務

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

[[email protected] 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服務

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

[[email protected] 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

登陸資料庫:

 psql

預設登陸postgresql資料庫是不要求輸入密碼的

本文出自 “10931853” 部落格,請務必保留此出處http://wujianwei.blog.51cto.com/10931853/1970386

postgreSQL二進位快速安裝

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.