日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > 数据库 >内容正文

数据库

ubuntu14.04 LTS 源码编译安装postgreSQL

發布時間:2023/12/19 数据库 24 豆豆
生活随笔 收集整理的這篇文章主要介紹了 ubuntu14.04 LTS 源码编译安装postgreSQL 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

一、環境

  ubuntu14.04

  postgresql-9.4.3

二、安裝

  1、依賴包安裝

sudo apt-get install libperl-dev python-dev libreadline-gplv2-dev zlib1g-dev

  2、下載postgreSQL,編譯安裝

wger https://ftp.postgresql.org/pub/source/v9.4.3/postgresql-9.4.3.tar.bz2 tar -jxvf postgresql-9.4.3.tar.bz2 -C /usr/local/src/ ./configure --prefix=/usr/local/postgresql-9.4.3 --with-perl --with-python sudo make && sudo make install cd /usr/local/ sudo ln -fs postgresql-9.4.3/ pgsql

  在編譯安裝路徑是加上了版本號,加上版本號的原因是為了以后升級方便;如果postgreSQL9.4.4發布了,自需要在編譯postgreSQL9.4.4后,將現有的數據庫停掉,然后把鏈接/usr/local/pgsql指向/usr/local/postgresql-9.4.4。

  3、配置環境變量

  安裝完成后,配置postgresql可執行文件的路徑和共享庫的路徑,數據庫目錄

export PATH=/usr/local/pgsql/bin:$PATH export LD_LIBRARY_PATH=/usr/local/pgsql/lib

  如果想以上配置對所有用戶都生效,可以把上面的內容添加到/etc/profile文件中。如果想以上的配置對當前用戶生效,在linux下可以把以上內容添加到.bashrc文件中,在其他的unix下可以添加到.profile文件中。

  4、創建數據庫簇

sudo mkdir -p /data/pgdata
sudo mkdir -p /data/pglog/postgresql.log
export PGDATA=/data/pgdata #數據目錄環境變量
adduser postgres
sudo chown -R /data initdb -D /data/pgdata

 顯示如下:

The files belonging to this database system will be owned by user "postgres". This user must also own the server process.The database cluster will be initialized with locale "zh_CN.UTF-8". The default database encoding has accordingly been set to "UTF8". initdb: could not find suitable text search configuration for locale "zh_CN.UT F-8" The default text search configuration will be set to "simple".Data page checksums are disabled.fixing permissions on existing directory /data/pgdata ... ok creating subdirectories ... ok selecting default max_connections ... 100 selecting default shared_buffers ... 128MB selecting dynamic shared memory implementation ... posix creating configuration files ... ok creating template1 database in /data/pgdata/base/1 ... ok initializing pg_authid ... ok initializing dependencies ... ok creating system views ... ok loading system objects' descriptions ... ok creating collations ... ok creating conversions ... ok creating dictionaries ... ok setting privileges on built-in objects ... ok creating information schema ... ok loading PL/pgSQL server-side language ... ok vacuuming database template1 ... ok copying template1 to template0 ... ok copying template1 to postgres ... ok syncing data to disk ... okWARNING: 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:postgres -D /data/pgdata/ orpg_ctl -D /data/pgdata/ -l logfile start

 5、 安裝contrib目錄下的工具

cd postgresql-9.4.3/contrib make sudo make install

  6、啟動和停止數據庫

pg_ctl start -D /data/pgdata -l /data/pglog/postgresql.log pg_ctl stop -D /dtat/pgdata

?  7、測試

netstat -nultp | grep

tcp ? ? ? ?0 ? ? ?0 192.168.45.127:5432 ? ? 0.0.0.0:* ? ? ? ? ? ? ? LISTEN ? ? ?16015/postgres

?

轉載于:https://www.cnblogs.com/chrisDuan/p/4571195.html

總結

以上是生活随笔為你收集整理的ubuntu14.04 LTS 源码编译安装postgreSQL的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。