[分享]在ubuntu linux上安装设置firebird
发表于 : 2007-12-02 15:45
由于本人未能成功在ubuntu上安装firebird数据库,于是跑到firebird的主页上找答案,还真在firebrid的主页上找到了一个文档,虽然是针对ubuntu 6.10+firebird1.5的,我想对于ubuntu 7.10和firebird2.0也是一样的。我将这份文档翻译成了中文,本人英语底子薄,不对之处,还望指教。另外本人只是阅读了文档,还没有进行实验呢:oops:
特别提醒,安装源里的firebird2其实是firebird1.5并不是firebird2.0
在ubuntu linux上安装设置firebird
这份文档描述了在ubuntu linux上安装和运行firebird的过程。像在基于Debian GNU/Linux发行版一样,在ubuntu上安装软件是非常简单直接的,firebird也不例外。这份指南基于ubuntu 6.10 "Edgy Eft"。
Ubuntu "Edgy Eft"使用的Firebird包的版本是 1.5.3.4870-10,但是被称为firebirdsql2。从已开始,ubuntu严格的按照每6个月一个发行循环,所以这也许在2007年4月发行的代号为"Feisty Fawn"的版本中改变。(我在7.10版本看到,有不少叫做firebird的包,有1.5的,有2.0的,有2的就是1.5的,然后分为classic版和super版,仔细看一下描述就会明白的。)
在目标计算机上使用管理员权限执行下列命令:
# apt-get install firebird2-super-server
Apt的包依赖分析机制会自动请求完全安装需要的所有的需要的包,并且输出下列内容:
The following extra packages will be installed:
firebird2-common firebird2-server-common libfbclient1
Recommended packages:
firebird2-server
The following NEW packages will be installed
firebird2-common firebird2-server-common firebird2-super-server
libfbclient1
Need to get 2342kB of archives.
After unpacking 5976kB of additional disk space will be used.
Do you want to continue [Y/n]?
当询问你选择"Classic"或者"Super"服务器时,选择其中一个,忽略"firebird2-server"虚拟包。(其实在Ubuntu7.10的安装源里"classic"安装包和"Super"安装包是直接分开的。)原文如下,理解不太清楚:
Ignore the “firebird2-server” virtual package which will just ask you to select either the “Classic” or “Super” server.
这个软件包将下载并且安装到目标机器上,一个名为"firebird"的新用户被建立来运行服务,这个服务程序会立即启动:
Setting up firebird2-super-server (1.5.3.4870-10) ...
Created default security.fdb
Starting Firebird server: server has been successfully started
你将被询问为SYSDBA用户输入一个新口令,包括拼写错误:
Plase enter new password for SYSDBA user:
随着下面的输出你将返回到shell提示符下,就像这样!
GSEC> GSEC>
如果你是一个有经验的Unix用户,但是对Ubuntu是新人,你会对Firebird的文件被安置于很深的目录感到很惊奇。要使用Apt查看所有这些文件被安装到什么地方,直接这样:
# dpkg -L firebird2-super-server
/.
/usr
/usr/lib
/usr/lib/firebird2
/usr/lib/firebird2/bin
/usr/lib/firebird2/bin/fb_lock_print
/usr/lib/firebird2/bin/fbserver
/usr/lib/firebird2/bin/fbguard
/usr/lib/firebird2/bin/fbmgr.bin
/usr/lib/firebird2/UDF
/usr/lib/firebird2/UDF/fbudf.so
/usr/bin
/usr/bin/gsec
/usr/bin/fbmgr
/usr/share
/usr/share/lintian
/usr/share/lintian/overrides
/usr/share/lintian/overrides/firebird2-super-server
/usr/share/doc
/usr/share/doc/firebird2-super-server
/usr/share/doc/firebird2-super-server/README.Debian
/usr/share/doc/firebird2-super-server/TODO.Debian
/usr/share/doc/firebird2-super-server/copyright
/usr/share/doc/firebird2-super-server/NEWS.Debian.gz
/usr/share/doc/firebird2-super-server/changelog.gz
/usr/share/doc/firebird2-super-server/changelog.Debian.gz
/usr/share/man
/usr/share/man/man1
/usr/share/man/man1/fbmgr.1.gz
/usr/share/man/man1/gsec.1.gz
/etc
/etc/init.d
/etc/init.d/firebird2
/usr/lib/firebird2/bin/fbmgr
/usr/lib/firebird2/bin/gsec
在这个时候,一个新用户"firebird"已经在目标机器上建立。使用管理员权限,为这个新用户设置一个口令:
# passwd firebird
Enter new UNIX password:
Retype new UNIX password:
如果需要,现在你可以使用su命令切换到firebird用户了。
如果你尝试使用init.d命令从运行状态停止服务,将会出现一个错误信息。
# /etc/init.d/firebird2 stop
/etc/init.d/firebird2: 28: source: not found
Stopping Firebird server: Your user name and password are not
defined. Ask your database administrator to set up a Firebird
login.
can not attach to server
如果你尝试启动服务会出现同样的信息。要解决这个问题需要对Debian和Ubuntu的Firebird软件包进行更深入的调查和讨论,但是现在可以这样停止服务:
# su -c "fbmgr -shut -password SYSDBApassword" firebird
Password:
server shutdown completed
这里SYSDBApassword是你在安装后立即输入的那个口令,第二个口令是firebird用户口令。要重新启动服务:
# su -c "fbmgr -start" firebird
在安装完成以后,你现在可以在Ubuntu Linux上使用Firebird了。这个基本软件包并不包括例子数据库,假如你喜欢,使用下面的命令安装一些:
# apt-get install firebird2-examples
这些例子将安装在/usr/share/doc/firebird2-examples/。当你需要,可以安装工具软件包。
# sudo apt-get install firebird2-utils-super
他们之中将给你提供一个交互式shell环境,一个备份和报表工具。现在你可以使用连接到例子数据库来测试你的Firebird安装。解压缩"employee.fdb"数据库:
# gunzip
# /usr/share/doc/firebird2-examples/examples/employee.fdb.gz
启动交互式shell环境。
# isql-fb
在SQL>提示符下,使用下列命令连接到数据库:
SQL> connect "employee.fdb" user 'SYSDBA' password 'SYSDBApassword';
如果你得到一个像“Statement failed, SQLCODE = -551 no permission for read-write access to database /usr/share/doc/firebird2-examples/examples/employee.fdb”类似的错误信息,那么是服务进程没有读写数据库文件的权限。使用下面的命令改变数据库的所有权到用户firebrid:
# chown firebird:firebird employee.fdb
当你成功的连接到数据库时你将看到这样的信息:
Database: "employee.fdb", User: SYSDBA
现在,从SQL>提示符,自由的浏览employee数据库:
SQL> show tables;
COUNTRY CUSTOMER
DEPARTMENT EMPLOYEE
EMPLOYEE_PROJECT JOB
PHONE_LIST PROJECT
PROJ_DEPT_BUDGET SALARY_HISTORY
SALES
如果你如此成功地在ubuntu上安装了Firebird。祝你玩的愉快。
特别提醒,安装源里的firebird2其实是firebird1.5并不是firebird2.0
在ubuntu linux上安装设置firebird
这份文档描述了在ubuntu linux上安装和运行firebird的过程。像在基于Debian GNU/Linux发行版一样,在ubuntu上安装软件是非常简单直接的,firebird也不例外。这份指南基于ubuntu 6.10 "Edgy Eft"。
Ubuntu "Edgy Eft"使用的Firebird包的版本是 1.5.3.4870-10,但是被称为firebirdsql2。从已开始,ubuntu严格的按照每6个月一个发行循环,所以这也许在2007年4月发行的代号为"Feisty Fawn"的版本中改变。(我在7.10版本看到,有不少叫做firebird的包,有1.5的,有2.0的,有2的就是1.5的,然后分为classic版和super版,仔细看一下描述就会明白的。)
在目标计算机上使用管理员权限执行下列命令:
# apt-get install firebird2-super-server
Apt的包依赖分析机制会自动请求完全安装需要的所有的需要的包,并且输出下列内容:
The following extra packages will be installed:
firebird2-common firebird2-server-common libfbclient1
Recommended packages:
firebird2-server
The following NEW packages will be installed
firebird2-common firebird2-server-common firebird2-super-server
libfbclient1
Need to get 2342kB of archives.
After unpacking 5976kB of additional disk space will be used.
Do you want to continue [Y/n]?
当询问你选择"Classic"或者"Super"服务器时,选择其中一个,忽略"firebird2-server"虚拟包。(其实在Ubuntu7.10的安装源里"classic"安装包和"Super"安装包是直接分开的。)原文如下,理解不太清楚:
Ignore the “firebird2-server” virtual package which will just ask you to select either the “Classic” or “Super” server.
这个软件包将下载并且安装到目标机器上,一个名为"firebird"的新用户被建立来运行服务,这个服务程序会立即启动:
Setting up firebird2-super-server (1.5.3.4870-10) ...
Created default security.fdb
Starting Firebird server: server has been successfully started
你将被询问为SYSDBA用户输入一个新口令,包括拼写错误:
Plase enter new password for SYSDBA user:
随着下面的输出你将返回到shell提示符下,就像这样!
GSEC> GSEC>
如果你是一个有经验的Unix用户,但是对Ubuntu是新人,你会对Firebird的文件被安置于很深的目录感到很惊奇。要使用Apt查看所有这些文件被安装到什么地方,直接这样:
# dpkg -L firebird2-super-server
/.
/usr
/usr/lib
/usr/lib/firebird2
/usr/lib/firebird2/bin
/usr/lib/firebird2/bin/fb_lock_print
/usr/lib/firebird2/bin/fbserver
/usr/lib/firebird2/bin/fbguard
/usr/lib/firebird2/bin/fbmgr.bin
/usr/lib/firebird2/UDF
/usr/lib/firebird2/UDF/fbudf.so
/usr/bin
/usr/bin/gsec
/usr/bin/fbmgr
/usr/share
/usr/share/lintian
/usr/share/lintian/overrides
/usr/share/lintian/overrides/firebird2-super-server
/usr/share/doc
/usr/share/doc/firebird2-super-server
/usr/share/doc/firebird2-super-server/README.Debian
/usr/share/doc/firebird2-super-server/TODO.Debian
/usr/share/doc/firebird2-super-server/copyright
/usr/share/doc/firebird2-super-server/NEWS.Debian.gz
/usr/share/doc/firebird2-super-server/changelog.gz
/usr/share/doc/firebird2-super-server/changelog.Debian.gz
/usr/share/man
/usr/share/man/man1
/usr/share/man/man1/fbmgr.1.gz
/usr/share/man/man1/gsec.1.gz
/etc
/etc/init.d
/etc/init.d/firebird2
/usr/lib/firebird2/bin/fbmgr
/usr/lib/firebird2/bin/gsec
在这个时候,一个新用户"firebird"已经在目标机器上建立。使用管理员权限,为这个新用户设置一个口令:
# passwd firebird
Enter new UNIX password:
Retype new UNIX password:
如果需要,现在你可以使用su命令切换到firebird用户了。
如果你尝试使用init.d命令从运行状态停止服务,将会出现一个错误信息。
# /etc/init.d/firebird2 stop
/etc/init.d/firebird2: 28: source: not found
Stopping Firebird server: Your user name and password are not
defined. Ask your database administrator to set up a Firebird
login.
can not attach to server
如果你尝试启动服务会出现同样的信息。要解决这个问题需要对Debian和Ubuntu的Firebird软件包进行更深入的调查和讨论,但是现在可以这样停止服务:
# su -c "fbmgr -shut -password SYSDBApassword" firebird
Password:
server shutdown completed
这里SYSDBApassword是你在安装后立即输入的那个口令,第二个口令是firebird用户口令。要重新启动服务:
# su -c "fbmgr -start" firebird
在安装完成以后,你现在可以在Ubuntu Linux上使用Firebird了。这个基本软件包并不包括例子数据库,假如你喜欢,使用下面的命令安装一些:
# apt-get install firebird2-examples
这些例子将安装在/usr/share/doc/firebird2-examples/。当你需要,可以安装工具软件包。
# sudo apt-get install firebird2-utils-super
他们之中将给你提供一个交互式shell环境,一个备份和报表工具。现在你可以使用连接到例子数据库来测试你的Firebird安装。解压缩"employee.fdb"数据库:
# gunzip
# /usr/share/doc/firebird2-examples/examples/employee.fdb.gz
启动交互式shell环境。
# isql-fb
在SQL>提示符下,使用下列命令连接到数据库:
SQL> connect "employee.fdb" user 'SYSDBA' password 'SYSDBApassword';
如果你得到一个像“Statement failed, SQLCODE = -551 no permission for read-write access to database /usr/share/doc/firebird2-examples/examples/employee.fdb”类似的错误信息,那么是服务进程没有读写数据库文件的权限。使用下面的命令改变数据库的所有权到用户firebrid:
# chown firebird:firebird employee.fdb
当你成功的连接到数据库时你将看到这样的信息:
Database: "employee.fdb", User: SYSDBA
现在,从SQL>提示符,自由的浏览employee数据库:
SQL> show tables;
COUNTRY CUSTOMER
DEPARTMENT EMPLOYEE
EMPLOYEE_PROJECT JOB
PHONE_LIST PROJECT
PROJ_DEPT_BUDGET SALARY_HISTORY
SALES
如果你如此成功地在ubuntu上安装了Firebird。祝你玩的愉快。