4

I've installed firebird 3.0 from the package provided by firebirdsql.org.

If I try to use a local connection to a database: isql employee -user SYSDBA it fails with:

Can not access lock files directory /tmp/firebird/

So adding read/write/execute permissions to /tmp/firebird/
sudo chmod a+rwx /tmp/firebird/
and executing the command again yields:

Statement failed, SQLSTATE = 08001
I/O error during "open" operation for file "/tmp/firebird/fb_init"
-Error while trying to open file
-Unknown error: -1

This all will work if I sudo the calls, but is this really necessary?

What is the correct way to use a local connection to firebird database on macOS?

Arioch 'The
  • 15,799
  • 35
  • 62
jonjonas68
  • 495
  • 4
  • 13
  • this is not just any access, but probably is "embedded server" kind of access. Mac OS at that. Very specific case, try to ask in Firebird Support mail list https://www.firebirdsql.org/en/mailing-lists/ – Arioch 'The Jun 27 '18 at 14:27

3 Answers3

7

I found CORE-3871 issue in the firebird issue tracker, which describes the problem and it's solution. The user which tries to open the local connection must be member of the firebird user group.

So a user is added to the firebird group on mac bash with the following command:
sudo dseditgroup -o edit -a myusername -t user firebird

If you try to open the sample database employee, shipped with firebird, it's also necessary to grant the group write access to the employee.fdb:
sudo chmod g+w /Library/Frameworks/Firebird.framework/Resources/examples/empbuild/employee.fdb

Now /Library/Frameworks/Firebird.framework/Resources/bin/isql employee -user SYSDBA should work

jonjonas68
  • 495
  • 4
  • 13
  • if your SYSDBA users were created (for doing it you would need to have embedded access, unless the installer already did it for you) and the FB server is running as a system demon, as a separate process, then you can connect to it for example using TCP/IP protocol. That will give you a bit more stability (if your app crashes - it would be just your app, not the server, thus less risk of damaging DB file) and it would require the firebird daemon user to have file I/O grants on the database, not your app's user, which hperhaps is a good thing for multi-use client-server apps – Arioch 'The Jun 29 '18 at 12:24
  • perhaps commands like `isql localhost:employee` or `isql inet4://employee` - see https://www.firebirdsql.org/file/documentation/release_notes/html/en/3_0/rnfb30-apiods-api.html#rnfb30-apiods-api-winlocal You can probably also use FlameRobin GUI, where the connection method would be easier to set explicitly. But tha tall after you both created SYSDBA users and made FB daemon to run on its own – Arioch 'The Jun 29 '18 at 12:27
0

I only put -p and the password and it's just fine. It's working.

Carlos
  • 91
  • 1
  • 3
0

You current command creates the Firebird Embedded database engine to connect to the database. To be able to do that, your current OS user needs to have sufficient access to the database file. For details how to fix that, see the answer by jonjonas68.

An alternative to solution - if you have the Firebird server running - is to connect through the Firebird server process, for example using isql localhost:employee -user sysdba -password <sysdbapassword>. Then the file permissions of the user running the Firebird server process will be applied. However, in that situation, you will need to specify a password when connecting, as passwordless authentication is only applied for Firebird Embedded connections.

Mark Rotteveel
  • 100,966
  • 191
  • 140
  • 197