Debian Linux 安裝firebird 數據庫並基本設置

今天在QQ上,有網友問我能否將FIREBIRD數據庫遷移到unix/Linux,並作優化。俺心想,這個數據庫平時比較小眾,不像ORACLE,DB2,MYSQL這些數據庫那麼普遍,就不妨研究一下,就想着在LINUX下安裝一套FIREBIRD數據庫。

下面為安裝過程:

首先就想着在centos  安裝,首先yum search firebird,發現centos沒有收錄firebrid數據庫。

root@co1 ~]# yum search Firebird
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Warning: No matches found for: Firebird
No Matches found

那麼,就只能從官網拉源代碼包,準備編譯安裝。
[root@co1 ~]# which wget
/usr/bin/wget
[root@co1 ~]# pwd
/root
[root@co1 ~]# wget https://github.com/FirebirdSQL/firebird/releases/download/R3_0_4/Firebird-3.0.4.33054-0.amd64.tar.gz

解壓源代碼,發現只有三個文件,並且有一個install.sh文件:

[root@co1 install]# cd Firebird/
[root@co1 Firebird]# ls
Firebird-3.0.4.33054-0.amd64.tar.gz
[root@co1 Firebird]# tar zxvf *.tar.gz
Firebird-3.0.4.33054-0.amd64/
Firebird-3.0.4.33054-0.amd64/install.sh
Firebird-3.0.4.33054-0.amd64/buildroot.tar.gz
Firebird-3.0.4.33054-0.amd64/manifest.txt
[root@co1 Firebird]# cd Firebird-3.0.4.33054-0.amd64
[root@co1 Firebird-3.0.4.33054-0.amd64]# ls
buildroot.tar.gz install.sh manifest.txt

安裝firebird.如下:

[root@co1 Firebird-3.0.4.33054-0.amd64]# ./install.sh

遇到報錯:

irebird 3.0.4.33054-0.amd64 Installation

Press Enter to start installation or ^C to abort
Please install required library ‘libtommath’ before firebird, after it repeat firebird install

想着是lib,想着yum 會有收錄,就直接yum search libtommath,還是找不到:

[root@co1 Firebird-3.0.4.33054-0.amd64]# yum search libtommath
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Warning: No matches found for: libtommath
No Matches found
[root@co1 Firebird-3.0.4.33054-0.amd64]# yum search tommath
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Warning: No matches found for: tommath
No Matches found
[root@co1 Firebird-3.0.4.33054-0.amd64]# yum search tommath
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Warning: No matches found for: tommath
No Matches found

通過baidu.找到lmt的sf 網址,下載一個lmt.tar.bz2的源代碼,並且,從google搜到好像debian下apt下帶有這個libtommath的源。加上不想花時間去編譯這個 lmt.tar.bz2文件,就切換到debin操作系統下:

root@debdesk:~# apt-cache search libtommath
libtommath-dev – multiple-precision integer library [development files]
libtommath-docs – multiple-precision integer library [documentation]
libtommath1 – multiple-precision integer library [runtime]
libtfm1 – Fast multiple-precision integer library [runtime]
root@debdesk:~#

安裝 libtommath ,如下:

apt-get install libtommath*

安裝完成後,再次wget下載firebird源代碼包:

wget https://github.com/FirebirdSQL/firebird/releases/download/R3_0_4/Firebird-3.0.4.33054-0.amd64.tar.gz

再解壓,再執行install.sh安裝,繼續遇到報錯:

Press Enter to start installation or ^C to abort
Extracting install data
Please enter new password for SYSDBA user: <password>
/opt/firebird/bin/gsec: error while loading shared libraries: libtommath.so.0: cannot open shared object file: No such file or directory

Fatal error running ‘systemctl –quiet start firebird-superserver.service’ – exiting

提示找不到libtommath.so.0 ,但發現在/usr/lib/x86_64-linux-gnu目錄下,有幾個libtommath.so文件,那就將libtommath.so.1.0.0 建一個軟鏈接,

ln -s libtommath.so.1.0.0  libtommath.so.0

再次運行install.sh ,終於順利完成安裝。

基本設置:

查看firebird運行服務:

root@debdesk:~# ps -ef | grep fire
firebird 539 1 0 22:36 ? 00:00:00 /opt/firebird/bin/fbguard -pidfile /var/run/firebird/firebird.pid -daemon -forever
firebird 544 539 0 22:36 ? 00:00:00 /opt/firebird/bin/firebird
root 969 896 0 22:54 pts/0 00:00:00 grep fire

firebird 成功啟動,默認會打開監聽端口3050

netstat -na |grep 3050

登陸firebird並新建數據庫.

root@debdesk:~# cd /opt/firebird/bin/
root@debdesk:/opt/firebird/bin# ./isql
Use CONNECT or CREATE DATABASE to specify a database
SQL>CREATE DATABASE ‘/opt/firebird/zymhdb.fdb’ page_size 8192;

最後用Firebirdmaestro等firebird客戶端工具來連接 firebird數據庫。

 

 

 

 

 

以下文章點擊率最高

Loading…

     

如果這文章對你有幫助,請掃左上角微信支付-支付寶,給於打賞,以助博客運營