Ubuntu 下 firebird 数据库的安装和配置

1、简介

本文主要是 Ubuntu 下 firebird 数据库的安装和目录迁移,同样适用于 Debian
系统:Ubuntu 20.0.4
firebird:3.0
注意:文中运行的命令基本上需要管理员权限

2、安装 firebird

以下包可以按照需要安装

安装 firebird 服务器
apt install firebird3.0-server
只安装 firebird 数据库管理工具 gbak 和 isql-fb
apt install firebird3.0-server-core
用c/c++等 开发 firebird 客户端
apt install firebird-dev

3、配置 firebird 服务器

停止 firebird 服务,终端输入 systemctl stop firebird3.0

编辑 /etc/firebird/3.0/firebird.conf 文件

DatabaseAccess = Full
表示所有目录的数据库都可以访问
DatabaseAccess = None
表示只有”别名数据库”可以访问
选择默认即可

RemoteAccess = true
允许远程访问,建议开启,要不然很多都操作不了

RemoteBindAddress = localhost
远程访问地址绑定,有非本机(127.0.0.1)访问需求的,把这行注释掉加#,建议注释掉

其它设置可以查看 /etc/firebird/3.0/firebird.conf 文件,里面有详细的说明

开启 firebird 服务,终端输入 systemctl start firebird3.0,设置完毕

4、配置 firebird 数据库别名

编辑 /etc/firebird/3.0/databases.conf 文件,按照文件里这几行例子写就行了
big 是别名 = 文件路径

big = /databases/bigdb.fdb
{
LockMemSize = 32M # We know that bigdb needs a lot of locks
LockHashSlots = 19927 # and big enough hash table for them
}

注意数据库的读写权限和组都要设置为 firebird

5、使用 gbak 备份和恢复数据

备份数据库,例如备份本地别名为 myfbdb 数据库
gbak -user sysdba -password masterkey -b -verify -y ~/myfbdb.log 127.0.0.1:myfbdb ~/myfbdb.fbk

恢复数据库,例如恢复本地别名为 myfbdb 数据库
gbak -user sysdba -password masterkey -c -verify -y ~/myfbdb.log ~/myfbdb.fbk 127.0.0.1:myfbdb

6、使用 isql-fb 管理数据库

使用需要登录的远程数据库的用户和密码为参数

isql-fb -u sysdba -p masterkey
然后在 SQL 命令里
connect 127.0.0.1:myfbdb;
就能连接数据库了,连接本地数据库也要用 127.0.0.1:myfbdb 的方式连接,要不然会有没有读写权限的错误
或者用 sudo isql-fb 的方式运行,但是不建议。
还是用 IP 地址加”别名”的方式进行访问比较好。

Original: https://www.cnblogs.com/cnhemiya/p/14832223.html
Author: 小熊宝宝啊
Title: Ubuntu 下 firebird 数据库的安装和配置

原创文章受到原创版权保护。转载请注明出处:https://www.johngo689.com/567278/

转载文章受原作者版权保护。转载请注明原作者出处!

(0)

大家都在看

亲爱的 Coder【最近整理,可免费获取】👉 最新必读书单  | 👏 面试题下载  | 🌎 免费的AI知识星球