On 01-05-2021 17:25, Kentechy wrote:
> I have a Firebird 2.5 database on a windows 10 machine. I am able to
> use ODBC from other windows machines without any issue using the odbc
> admin tool in windows, the server:drive:/share/database path, and the
> login credentials. Everything works fine.
Firebird - at least by default - does not open database on a remote
share. It only opens database files on the same machine. So putting the
database in a location that is accessible as a network share is
generally wrong. Don't do that. It is a great way to accidentally
corrupt a database if the database file is opened or modified remotely,
and a good source of dataleaks because anyone with access to the share
can copy the file.
> Currently I have an apache server running on windows 10 that I odbc into
> the other window 10 machine that has the firebird database and I am able
> to pull out information that I can then use in php through odbc_connect
> to serve to our intranet. I would like to have this all running on an
> Ubuntu machine.
>
> This works fine so long as its windows, but once I try to do this on
> linux/ubuntu, the documentation I am finding is very lacking in this
> case. I cannot find definite answers on if the odbc.ini and
> odcbinst.ini should be in the /etc or the /usr/lib directories. I
> cannot find an answer on what exactly should be in those configs.
The requirements for the location of the ODBC configuration are not
dictated by Firebird, but by the unixODBC library. As far as I
understand, the default location is /etc/odbc.ini and /etc/odbcinst.ini
and ~/.odbc.ini for user-specific DSNs, but the location might be
different depending on the distribution.
See also
https://firebirdsql.org/file/documentation/html/en/refdocs/fbodbc20/firebird-odbc-driver-20-manual.html#fbodbc205-linux-config
and
http://www.unixodbc.org/odbcinst.html
> I cannot find an answer on how firebird odbc expects the path to be
> written...should it be mounted and pointed at the mount? Should it use
> the ip/share syntax? Should it use the fqdn? All the configs I see
> online use localhost, but this is not local.
You should not use shares nor mount points for a Firebird database, you
should connect to a remote Firebird server process which opens the
database for you. You need to configure the URL as is correct for the
server you're connecting to.
If the database is on server dbserver.local and the database file on
that server is C:\path\to\database.fdb, then your connection string is
dbserver.local:C:\path\to\database.fdb (or use
dbserver.local:C:/path/to/database.fdb as you may need to escape \ to \\)
From dbserver.local you could also connect (assuming the server is
listening on all IP addresses of the host) using
localhost:C:\path\to\database.fdb)
In general it is advisable not to use file paths in the connection
string to your database, but instead define an alias in aliases.conf (or
for Firebird 3 and higher, databases.conf) and use that. That makes it
easier to move a database to a different location, or even change your
OS (e.g. from Windows to Linux).
For example add to aliases.conf:
mydb = C:\path\to\database.fdb
and then you can use the connection string dbserver.local:mydb instead
of dbserver.local:C:\path\to\database.fdb
> Does anyone know of a more thorough linux odbc to windows firebird 2.5
> set of documentation somewhere?
>
> I have been trying for days and have not been successful in connecting
> the to database from Ubuntu. It says the database is not found.
I recommend you read the documentation I linked above, and if you still
have problems, then please share your current setup (where is your
server, what is its hostname, where is the database on that server), and
what you've tried.
Mark
--
Mark Rotteveel