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…

     

如果这文章对你有帮助,请扫左上角微信支付-支付宝,给于打赏,以助博客运营

发表评论

您的电子邮箱地址不会被公开。 必填项已用*标注