2015-07-01 91 views
1

我遵循这个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 

什么跟这是错误的?

+0

第一个猜测:尝试'sudo isql-fb' – lordvlad

+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具有组写入权限(推荐)
+0

另一种方法是确保Firebird服务器已启动并通过服务器连接。如果你没有指定主机名,就会建立一个本地连接,在数据库上需要足够的用户权限,而通过Firebird服务器连接将使用数据库服务器的权限。 –

+0

使用'chmod 777'修复权限基本上是不正确的。你需要找出正确的权限,但他们永远不会是777。 – tripleee

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

保存并重启火鸟服务,如:

sudo service firebird-2.5"theversionyouhave" restart

您必须更改像目录的所有者此:

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

现在你可以使用flamerobin没有任何麻烦...