无法连接到firebird

时间:2015-07-01 10:33:24

标签: ubuntu firebird

我几乎逐行地遵循docs

sudo add-apt-repository ppa:mapopa
sudo apt-get update
apt-cache search firebird2.5-*
sudo apt-get install firebird2.5-superclassic
sudo dpkg-reconfigure firebird2.5-superclassic

在此阶段,我看到一个提示,要求我为SYSDBA设置密码,因此我将其设置为root。然后我做其余的事情:

sudo apt-get install firebird2.5-examples firebird2.5-dev 
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/

最后:

$ isql-fb
SQL> connect "/var/lib/firebird/2.5/data/employee.fdb " user 'SYSDBA' password 'root';

因此,我收到以下错误消息:

Statement failed, SQLSTATE = HY000
operating system directive open failed
-Permission denied

这有什么问题?

2 个答案:

答案 0 :(得分:3)

您的数据库文件可能仅限于超级用户,因为您正在进行sudo gunzip ..., sudo chown ..., sudo ...

  • 尝试sudo isql-fb以超级用户身份工作(不是最佳选择)
  • 尝试sudo chmod 777 employee.fdb使文件可读/可写(也不是最好的选项)
  • 尝试sudo useradd -G {user} firebird将自己添加到firebird组和sudo chmod g+w employee.fdb以确保employee.fdb具有组写权限(推荐)

答案 1 :(得分:0)

我遇到了同样的问题,所以我决定发布这个解决方案:

你必须做一些事情......首先,让我们看一下安全问题......

在档案/etc/firebird/2.5/firebird.conf

section: DatabaseAccess必须是这样的:

DatabaseAccess限制/the/directory/you/want/to/put/the/database

现在,在文件/etc/firebird/2.5/aliases.conf中放置了别名和目录...

diryouwant = /the/directory/you/want/to/put/the/database/database.fdb

保存并重启firebird服务,如:

sudo service firebird-2.5"theversionyouhave" restart

您必须像这样更改目录所有者:

sudo chown firebird.firebird /the/directory/you/want/to/put/the/database

现在你可以毫无困难地使用flamerobin ......

相关问题