Local connection strings
An explicit local connection string consists of the path + filename specification in the native format of the filesystem used on the server machine, for example
-
on a Linux or other Unix-like server:
/opt/firebird/examples/empbuild/employee.fdb
-
on a Windows server:
C:\Biology\Data\Primates\Apes\populations.fdb
Many clients also allow relative path strings (e.g. “..\examples\empbuild\employee.fdb
”), but you should use these with caution, as it’s not always obvious how they will be expanded.Getting an error message is annoying enough, but applying changes to another database than you thought you were connected to may be disastrous.
Instead of a file path, the local connection string may also be a database alias that is defined in databases.conf
, as mentioned earlier.The format of the alias depends only on how it’s defined in the configuration file, not on the server filesystem.Examples are:
-
zappa
-
blackjack.fdb
-
poker
Upon receiving a local connection string, the Firebird client will first attempt to make a direct, embedded connection to the database file, bypassing authentication but respecting the SQL privileges and restrictions of the supplied user and/or role name.That is, if the Engine13
provider is enabled in firebird.conf
or databases.conf
— which it is by default.If the database file exists, but the connection fails because the client process doesn’t have the required access privileges to the file, a client-server connection is attempted (by the Loopback
provider), in this order:
-
On Windows: using XNET (shared memory) on the local machine;
-
Using TCP/IP via
localhost
.
You can force Firebird to use a certain protocol (and skip the embedded connection attempt) by prepending the protocol in URL style:
-
inet://zappa
(TCP/IP connection using an alias on the local machine) -
inet:///opt/firebird/examples/citylife.fdb
(TCP/IP connection using an absolute path on the local POSIX machine — notice the extra slash for the root dir) -
inet://C:\Work\Databases\Drills.fdb
(TCP/IP connection using an absolute path on the local Windows machine) -
xnet://security.db
(XNET connection using an alias on the local Windows machine) -
xnet://C:\Programmas\Firebird\Firebird_3_0\security3.fdb
(XNET connection using the full path on the local Windows machine)
Tip
|
If your XNET connections fail, it may be because the local protocol isn’t working properly on your machine.If you’re running Windows with terminal services enabled, this can often be fixed by setting If setting |