我找不到安装 Firebird 2.5 版或 3.0 版的好方法。
这可能吗?如果可以,怎么办?
答案1
Firebird 马厩2.5.x位于这LTS 和当前支持的存储库(ppa)Ubuntu 版本
必须通过这种方式添加 ppa 存储库
sudo add-apt-repository ppa:mapopa
然后你需要更新缓存存储库
sudo apt-get update
以下是检查 firebird2.5 相关软件包的方法
apt-cache search firebird2.5-*
安装超级服务器包(系统将询问您 SYSDBA 密码以及要启用的服务:Super Server、Classic 或 Super Classic)
sudo apt-get install firebird2.5-super
The following extra packages will be installed:
firebird2.5-common firebird2.5-common-doc firebird2.5-dev firebird2.5-server-common libfbclient2 libib-util
Suggested packages:
libfbembed2.5 firebird2.5-examples firebird2.5-doc
The following NEW packages will be installed:
firebird2.5-server-common firebird2.5-super
The following packages will be upgraded:
firebird2.5-common firebird2.5-common-doc firebird2.5-dev libfbclient2 libib-util
5 upgraded, 2 newly installed, 0 to remove and 21 not upgraded.
Need to get 5,442kB of archives.
After this operation, 11.3MB of additional disk space will be used.
Do you want to continue [Y/n]? y
或者,如果你有多个 CPU(双核或 SMP 机器),并且想要SMP 支持
sudo apt-get install firebird2.5-classic
或者
sudo apt-get install firebird2.5-superclassic
安装后您需要配置该包
sudo dpkg-reconfigure firebird2.5-super
安装示例和开发文件
sudo apt-get install firebird2.5-examples firebird2.5-dev
employee.fdb 档案将位于此目录 /usr/share/doc/firebird2.1-examples/examples/empbuild/ 下
cd /usr/share/doc/firebird2.5-examples/examples/empbuild/
sudo gunzip employee.fdb.gz
sudo chown firebird.firebird employee.fdb
sudo mv employee.fdb /var/lib/firebird/2.5/data/
Connect to database using the isql-fb console
$ isql-fb
SQL> connect "/var/lib/firebird/2.5/data/employee.fdb " user 'SYSDBA' password 'SYSDBApassword';
在 2.5 中使用经典或超经典时,始终在数据库路径前面使用 localhost: 这样,锁文件和共享内存段将归“firebird”用户所有。另一种方法是将自己添加到 firebird 组
$ sudo adduser `id -un` firebird
然后连接到 superclassic 或 classic 中的数据库
$ isql-fb
SQL> connect "localhost:/var/lib/firebird/2.5/data/employee.fdb " user 'SYSDBA' password 'SYSDBApassword';
如果一切正常,那么您将收到有关所连接数据库和用户的消息,然后就可以使用 SQL 提示符了
Database: "/var/lib/firebird/2.5/data/employee.fdb ", User: SYSDBA
SQL>
现在您可以检查服务器版本和表格
SQL> show tables;
COUNTRY CUSTOMER
DEPARTMENT EMPLOYEE
EMPLOYEE_PROJECT JOB
PROJECT PROJ_DEPT_BUDGET
SALARY_HISTORY SALES
SQL> show version;
ISQL Version: LI-V2.5.0.* Firebird 2.5
Server version:
Firebird/linux Intel (access method), version "LI-V2.5.0.* Firebird 2.5"
Firebird/linux Intel (remote server), version "LI-V2.5.0.* Firebird 2.5/tcp (eeepc)/P11"
Firebird/linux Intel (remote interface), version "LI-V2.5.0.* Firebird 2.5 Release Candidate 2/tcp (eeepc)/P11"
on disk structure version 11.1
创建新数据库
SQL> create database "/var/lib/firebird/2.5/data/first_database.fdb" user 'SYSDBA' password 'SYSDBAPASSWORD';
SQL> connect "/var/lib/firebird/2.5/data/first_database.fdb" user 'SYSDBA' password 'masterkey';
Commit current transaction (y/n)?y
Committing.
Database: "/var/lib/firebird/2.5/data/first_database.fdb", User: SYSDBA
SQL>
如果你想创建一个简单的表格,然后插入 1-2 行并从中选择,这里有一个例子
SQL> CREATE TABLE TEST (ID INT NOT NULL PRIMARY KEY, NAME VARCHAR(20));
SQL> show tables;
TEST
SQL> INSERT INTO TEST VALUES (1, 'John');
SQL> INSERT INTO TEST VALUES (2, 'Joe');
SQL> select * from test;
ID NAME
============ ====================
1 John
2 Joe
要退出 isql-fb 控制台,请输入 quit
SQL> quit
CON>;
对于一个好的开源 GUI 管理工具,你可以查看 ubuntu 存储库中包含的 flamerobin 管理工具,它可以通过一个简单的
sudo apt-get install flamerobin
然后从菜单应用程序->编程->使用它火焰罗宾
要将 firebird 与 php 一起使用,您需要 php5 驱动程序
sudo apt-get install php5-interbase libapache2-mod-php5
sudo php5enmod interbase
sudo /etc/init.d/apache2 restart
接下来,如果你需要安装一个 PHP 管理工具,比如 Firebird Web Admin
sudo apt-get install git-core
git clone git://github.com/mariuz/firebirdwebadmin.git
mv firebirdwebadmin /var/www/html/firebirdwebadmin
并将其加载到浏览器中http://localhost/firebirdwebadmin