odbcinst.ini(5)

πŸ“¦
version 2.3.14 Β· 4 versions
, in alpine 3.22, alpine 3.23, alpine 3.24, arch rolling, centos-stream 10, centos-stream 9, debian trixie, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

✨ NAME ✨

okay so this is odbcinst.ini(5) πŸŽ€ (the unixODBC manual pages, bestie!) and it's all about /etc/odbcinst.ini, the config file for unixODBC drivers πŸ’–

🌸 DESCRIPTION 🌸

/etc/odbcinst.ini is a configuration file for unixODBC drivers, and it's giving main character energy πŸ‘‘

The file can be updated by using the odbcinst utility (recommended) or edited by hand. Honestly the utility is the move πŸ’…

πŸ¦‹ FILE FORMAT πŸ¦‹

The general .ini file format is:

[SectionName1]
key1 = value1
key2 = value2
...

[SectionName2]
key1 = value1
key2 = value2
...

Each ODBC driver gets its own section, and you can refer to it by the name of that section in files such as odbc.ini. Inside each section, unixODBC also recognises the following keys, so pay attention 🧚

  • Description β€” a text string briefly describing the driver. Lowkey the vibe check for your driver πŸ’œ
  • Driver β€” a filesystem path to the actual driver library πŸ“
  • Setup β€” a filesystem path to the driver setup library ✨
  • FileUsage β€” okay this one's a bit special. The section named [ODBC] configures global options, and the keys recognised in the [ODBC] section include:
    • Trace β€” enables ODBC driver trace output, which is written to the file path specified by TraceFile πŸ”₯

Some ODBC drivers have their own trace control options. Unlike the Trace option, these separate options are usually specified at the Data Source Name (DSN) level, so don't mix them up bestie πŸ™ˆ

Trace will be enabled if the corresponding value contains any case variant of "1", "y", "yes" or "on" πŸ’–

  • TraceFile β€” specifies the system path or path-pattern that ODBC driver trace output will be written to. This option has no effect unless Trace is enabled. The default file location for trace output is /tmp/sql.log πŸ¦‹
WARNING: Setting TraceFile to a path writable by multiple users might not work correctly, as only the first user will be able to create and open the file. πŸ’€

πŸŽ€ TEMPLATE FILES πŸŽ€

Many ODBC drivers come with .ini file templates, which you can install by using the odbcinst utility. So easy 🫢

Template files use the same format as odbcinst.ini ✨

πŸ’… EXAMPLES πŸ’…

To install the unixODBC PostgreSQL driver, you can enter the following configuration into odbcinst.ini:

[PostgreSQL]
Description = PostgreSQL driver for GNU/Linux
Driver      = /usr/lib/psqlodbcw.so
Setup       = /usr/lib/libodbcpsqlS.so
FileUsage   = 1

Driver paths can vary depending on your operating system and whether your distribution is multi-arch enabled. Some drivers also require Driver64 and Setup64 entries, so keep that in mind 🌈

The above section can be referenced in odbc.ini like this:

Driver = PostgreSQL

The recommended way of adding the PostgreSQL driver to your system is by creating a template file containing:

[PostgreSQL]
Description = PostgreSQL driver for GNU/Linux
Driver      = /usr/lib/psqlodbcw.so
Setup       = /usr/lib/libodbcpsqlS.so

and then calling odbcinst like this:

# odbcinst -i -d -f template.ini

🧚 SEE ALSO 🧚

unixODBC(7), odbcinst(1), odbc.ini(5) ⭐

"The unixODBC Administrator Manual (HTML)" πŸ“–

πŸ‘‘ AUTHORS πŸ‘‘

The authors of unixODBC are Peter Harvey <pharvey@codebydesign.com> and Nick Gorham <nick@lurcher.org> 🫢

For a full list of contributors, refer to the AUTHORS file 🌸

unixODBC is licensed under the GNU Lesser General Public License. For details about the license, see the COPYING file πŸ”₯


bestie, you made it πŸ₯Ήβœ¨ this was odbcinst.ini(5) from unixODBC version 2.3.12, dated Tue 12 Jan 2021 πŸ’– slay forever πŸ’…πŸŒˆ

πŸ“¦ where this page comes from