Firebird Error while trying to create file, Permission denied

ぃ、小莉子 提交于 2020-05-29 04:19:05

问题


I'm trying to create a Firebird database in my home directory through Flamerobin however I always get

*** IBPP::SQLException ***
Context: Database::Create
Message: isc_dsql_execute_immediate failed

SQL Message : -902
Unsuccessful execution caused by a system error that precludes successful execution of subsequent statements

Engine Code    : 335544344
Engine Message :
I/O error during "open O_CREAT" operation for file "/home/user/test.fdb"
Error while trying to create file
Permission denied

even though the file is chmod 777, the file /etc/firebird/2.5/firebird.conf has been modified so that:

DatabaseAccess = Full

is set to allow access to all files. The service is running:

$ ps ax | grep fireb
 3909 ?        S      0:00 /usr/sbin/fbguard -daemon -forever -pidfile /var/run/firebird/2.5/fbserver.pid

even though strangely the netstat doesn't find the connection port:

netstat | grep 3050

and returns empty list.

If I connect to an existing database all works, for instance connecting to

/var/lib/firebird/2.5/system/help.fdb

correctly shows tables.


回答1:


I see two possible causes:

  1. You mention that the file is chmod 777, this implies that the file already exists, so creating a new database will fail.

  2. You are trying to create (or connect) to a file in a user folder (I assume yours), through the Firebird server (although the fact no server is running might indicate this isn't the case).

I assume that the Firebird server isn't running under your account (but under the firebird user), and therefore it isn't allowed to access files in your folder.

You need to create (or access) the database in a location where the Firebird user has sufficient access rights, or use a local (embedded) connection (although I am not sure if that is supported by flamerobin.




回答2:


You must do some things... first, let's see the security stuff...

in the file /etc/firebird/2.5/firebird.conf

section: DatabaseAccess it must be like this:

DatabaseAccess Restrict /the/directory/you/want/to/put/the/database

now, in the file /etc/firebird/2.5/aliases.conf

you put an alias and the directory...

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

save and restart the firebird service like:

sudo service firebird-2.5"theversionyouhave" restart

you must change the directory owner like this:

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

and now you can use flamerobin without any trouble...




回答3:


Check /home/user owner and mode and firebird process owner. I'm pretty sure user which running firebird just do not have access to this directory.




回答4:


I had same problem, as described, trying run firebird 2.5 in a Oracle Linux OS, can't restore any database with gbak, same error message.
After a search, I found an answer saying about permissions on the destination directory and on the temp directory.
My solution: as root:
first re-run firebird installer to grant that are no problems in installation;
after, create specific directory for firebird databases on / (example, /fdb),
move the backup files to this directory;
change owner of entire directory to firebird with this commands

chown firebird /fdb -R
chmod 700 firebird /fdb -R

after this, gbak is normally for me, running it as root.

reference: http://forums.devshed.com/firebird-sql-development-61/gbak-restore-linux-453690.html



来源:https://stackoverflow.com/questions/29942639/firebird-error-while-trying-to-create-file-permission-denied

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!