odbc.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 the manual name is odbc.ini(5) πŸ’– and it's all about the data source config files: /etc/odbc.ini and $HOME/.odbc.ini ✨ They're the unixODBC data source name (DSN) config files, and honestly they're iconic πŸ’…


🌸 DESCRIPTION 🌸

/etc/odbc.ini is the system-wide config file for ODBC Data Source Names (DSNs) 🏠 Everyone on the machine gets it.

$HOME/.odbc.ini is the user-specific version πŸ¦‹ It's just yours, bestie.

ngl the paths to both of these can be changed by unixODBC build options πŸ™ˆ If you want to check where your system is actually looking, run odbcinst -j and it'll tell you the default config file paths ✨


πŸ’œ NOTES πŸ’œ

🧸 Templates

Lots of ODBC drivers come with .ini file templates πŸ“„ The move is to use odbcinst to install them, so you're not hand-typing everything like it's 1999 😭

🧚 FILE FORMAT

okay so odbc.ini follows the pseudo-standard ini file syntax 🌈 You get one or more [section headings], and each one is followed by zero or more key = value attributes. Super simple, very cute.

πŸ“ [ODBC Data Sources] section

This section is mandatory 🫢 It lists every data source name (DSN) as a key, and the values are just comments. Each entry has to be matched by an ini file [section] that actually describes the data source, or it's giving incomplete πŸ’€

πŸ¦‹ Data Source Name [section]

Each data source is identified by a [section header], and that header is the DSN name your applications use πŸ’– Each DSN section can have values for these keys:

  • Driver (REQUIRED) β€” this is the name of the ODBC driver to use for the DSN, and it has to exactly match the [section name] of the driver definition in odbcinst.ini. You can see those with odbcinst -q -d ✨ No close enough, periodt.
  • Description β€” a human-readable description of the data source 🌷
  • Database β€” the database name or identifier πŸ—‚οΈ What it means depends on the driver. It could be a file path, a Unix socket path, or an identifier relative to a server name, etc.
  • Servername β€” the server name 🌐 Again, driver-specific, but usually it's a DNS name, an IP network address, or a driver-specific discovery identifier.

For the full list of supported parameters, check out the HTML-formatted "Administrator Manual" that ships with unixODBC πŸ“š You should also look at your ODBC driver's docs and any data-source templates your driver came with. Main character research energy πŸ’…


🧁 EXAMPLES 🧁

An example odbc.ini config file is shown in the "Administrator Manual" that ships with unixODBC πŸŽ€ Go peek at it, it's so helpful.


πŸ”— SEE ALSO πŸ”—

unixODBC(7), odbcinst(1), isql(1), iusql(1), odbcinst.ini(5) πŸ’œ

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


πŸ‘‘ AUTHORS πŸ‘‘

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

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


unixODBC is licensed under the GNU Lesser General Public License πŸ¦„ For the details, see the COPYING file.


πŸŽ€ Okay that's the whole thing, bestie πŸ’– This was odbc.ini(5) from unixODBC manual pages, version 2.3.12, dated Sun 10 Jan 2021 ✨ Now go make your DSNs slay πŸ’…πŸ”₯

πŸ“¦ where this page comes from