適用于:
redhat/suse linux: version 6.x
applix: version 5.0
postgresql: version 6.5.3
以下的安裝的大綱是安裝postgresql在redhat或者suse linux所必須的. 為了更新postgresql和更一步的參考資料,請訪問www.postgresql.org . 為了完整考慮, 這個文擋解釋怎樣編譯原始資料applixware安裝在 /opt/applix postgresql 安裝在/usr/local/postgresql 。 你用"root"用戶登陸:
1. 下載postgresql
a."ftp://ftp.postgresql.org/pub/"
b. 下載并保存為"postgresql-6.5.3.tar.gz"到你的home目錄
2. 分發安裝postgresql
a. 創建一個用戶'postgres' 和一個組'postgres' 如果他們都不存在于你的系統中. 這個用戶'postgres'的home目錄是 /var/lib/pgsql.
b. 把下載的文件移到 /var/lib/pgsql
c. 檢查flex 和postgres之間的兼容性:
$ flex --version
如果flex命令沒有找到,你就可能不需要它. 如果版本是2.5.2 or 2.5.4 或者更大. 如果是2.5.3 在2.5.2之前,你將也需要升級 flex. 從這里可以下載ftp://prep.ai.mit.edu/pub/gnu/flex-2.5.4.tar.gz.
d. 創建新得安裝目錄
$ su
$ cd /usr/src
$ mkdir pgsql
$ chown postgres:postgres pgsql
$ cd /usr/local
$ mkdir pgsql
$ chown postgres:postgres pgsql
$ exit
e. 解壓安裝文件
$ cd /usr/src/pgsql
$ gunzip -c ~/postgresql-v6.5.3.tar.gz | tar xvf -
f. 配置 /usr/local/pgsql:
$ cd /usr/src/pgsql/posgresql-6.5.3/src
$ ./configure --prefix=/usr/local/pgsql --with-odbc
|||g. 安裝 man 和 html 文件. 類型
$ cd /usr/src/pgsql/posgresql-6.5.3/doc
$ make install
h.編譯release:
$ cd /usr/src/pgsql/src
$ make all > make.log 2>&1 &
$ tail -f make.log
日志最后一行表明: 所有postgresql就緒. 準備安裝.
i. 安裝postgresql:
$ gmake install > make.install.log 2>&1 &
$ tail -f make.install.log
最后一行解釋為: 謝謝你使用postgresql
j. 告訴你系統怎樣找到新的共享的庫
1. 作為root,編輯文件 /etc/ld.so.conf. 加入一行
/usr/local/pgsql/lib
2. 運行
$ /sbin/ldconfig
k. 增加路徑至.bash_profile為你和 'postgres'用戶
path=$path:/usr/local/pgsql/bin
manpath=$manpath:/usr/local/pgsql/man
pglib=/usr/local/pgsql/lib
pgdata=/usr/local/pgsql/data
export path manpath pglib pgdata
確信你完整的定義了這些變量:
$ source ~/.bash_profile
3. 快速安裝 postgresql測試
a. 以用戶 'postgres'創建一個數據庫:
$ su postgres
$ initdb
b. 設置許可的數據庫通道
這一步要編輯文件 /usr/local/pgsql/data/pg_hba.conf. 這個文件的默認設置已經足夠測試:
# by default, allow anything over unix domain sockets and localhost.
local all trust
host all 127.0.0.1 255.255.255.255 trust
c. 鍵入命令在后臺運行postmaster daemon
$ cd
$ nohup postmaster -i > pgserver.log 2>&1 &
|||d. 創建一個庫
$ createdb
e. 連接新的數據庫
$ psql
f. 運行簡單的請求
postgres select datetime 'now';
g. 退出psql
postgres=> q
h. 增加postgres用戶
$ su - postgres
$ createuser michele
enter user's postgres id or return to use unix user id: 500 ->
is user "tester" allowed to create databases (y/n) y
is user "tester" a superuser? (y/n) y
createuser: tester was successfully added
i. 給用戶增加一個數據庫
$ su -
$ createdb
4. 配置applixware
a. 編輯 /opt/applix/axdata/axnet.cnf 文件,增加下幾行 :
libfor gsqlodbc /opt/applix/axdata/axshlib/
注意: 在applixware 5.0或更高的版本中這個步驟取消
b. 增加"axnet" 到 /etc/services
axnet 5492/tcp # applix comms process
c. 在后臺啟動applix axnet程序:
$ /opt/applix/axdata/axnet &
d. 接著創建".odbc.ini"文件,在用戶home目錄下:
[odbc data sources]
postgresql=postgresql database
[postgresql]
driver=/usr/local/pgsql/lib/libpsqlodbc.so
database=michele
server=localhost
port=5432
readonly=0
[odbc]
trace=1
tracefile=/tmp/odbctrace.out
installdir=/opt/applix/axdata/axshlib
注意: 在applixware 5.0 包含一個 postgresql 驅動程序叫做 libodbcpsql.so 在/axdata/axshlib. 如果你想用在axnet.cnf中的odbcini變量你就必須要用這個驅動。
e. 啟動 applix data 連接postgresql
1. start applix data
2. select query->choose server
3. select the shelfsql tab
4. choose the gateway "shelf odbc"
5. click on "specify connection info..."
6. in the odbc connection dialog click on browse and choose the "postgresql" selection and click ok; this sets the "datasource" field
7. click ok in "choose server" dbox
8. enter your username for the login and type the password to the database that you created earlier. you should see it successfully connect (it will show a status of "ready" in the lower left-hand corner of the data window)
新聞熱點
疑難解答