macOS 上的 Firebird 3,本地连接失败,并显示:无法访问锁定文件目录 /tmp/firebird/



我已经从 firebirdsql.org 提供的软件包中安装了Firebird 3.0。

如果我尝试使用数据库的本地连接:isql employee -user SYSDBA它失败并显示:

无法访问锁定文件目录/tmp/firebird/

因此,向/tmp/firebird/sudo chmod a+rwx /tmp/firebird/
添加读/写/
执行权限并再次执行命令会产生:

语句失败,SQLSTATE = 08001
文件"/tmp/firebird/fb_init"的"打开">
操作期间出现 I/O 错误 - 尝试打开文件
时出错-未知错误:-1

如果我暂停通话,这一切都会起作用,但这真的有必要吗?

在macOS上使用本地连接到火鸟数据库的正确方法是什么?

我在火鸟问题跟踪器中发现了 CORE-3871 问题,它描述了问题及其解决方案。尝试打开本地连接的用户必须是火鸟用户组的成员。

因此,使用以下命令将用户添加到 mac bash 上的 firebird 组中:sudo
dseditgroup -o edit -a myusername -t userfirebird

如果您尝试打开 firebird 附带的示例数据库 employee,则还需要授予该组对 employee.fdb:
sudo chmod g+w/Library/Frameworks/Firebird.framework/Resources/examples/empbuild/employee.fdb

写入访问权限/Library/Frameworks/Firebird.framework/Resources/bin/isql employee -user SYSDBA应该工作

我只输入-p和密码,这很好。它正在工作。

当前命令创建 Firebird Embedded 数据库引擎以连接到数据库。为了能够执行此操作,您当前的操作系统用户需要对数据库文件具有足够的访问权限。有关如何解决此问题的详细信息,请参阅jonjonas68的答案。

解决方案的替代方法 - 如果您正在运行 Firebird 服务器 - 是通过 Firebird 服务器进程进行连接,例如使用isql localhost:employee -user sysdba -password <sysdbapassword>.然后,将应用运行 Firebird 服务器进程的用户的文件权限。但是,在这种情况下,您需要在连接时指定密码,因为无密码身份验证仅适用于 Firebird 嵌入式连接。

最新更新