2015-07-01 89 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沒有任何麻煩...