odbcinst
Configure ODBC drivers and data sources
SYNOPSIS
odbcinst [-d|-s] [-q|-i|-u] [-f filename] [-v]
PARAMETERS
-d
Operate on drivers defined in odbcinst.ini. If neither -d nor -s is specified, -d is assumed.
-s
Operate on data sources (DSNs) defined in odbc.ini.
-q
Query: List existing drivers or DSNs (depending on whether -d or -s is used). With -v, provide detailed information.
-i
Install: Install a new driver or DSN using the information from the configuration file specified by -f.
-u
Uninstall: Uninstall an existing driver or DSN specified in the configuration file by -f. The configuration file must contain the same name attribute as the driver or DSN to be removed.
-f filename
Specify the configuration file to use for installing or uninstalling a driver or DSN. The file must be in a specific format described in the unixODBC documentation. Usually .ini format.
-v
Verbose: Provide more detailed output when querying drivers or DSNs. When used with -q, it displays all attributes of each driver or DSN.
DESCRIPTION
The odbcinst command is a utility for configuring ODBC drivers and data source names (DSNs) on Linux and Unix-like systems.
It allows you to add, remove, and query ODBC driver and DSN information stored in the odbcinst.ini and odbc.ini files (or their system-wide equivalents). These files are the central repositories for ODBC configuration, allowing applications to connect to databases using ODBC drivers.
odbcinst simplifies the process of managing these configurations, providing a command-line interface to manipulate the driver and DSN entries directly. Without odbcinst, users would typically need to manually edit these .ini files, which can be error-prone. It offers standardized method for registering driver and DSN information.
CAVEATS
The exact location of the odbcinst.ini and odbc.ini files can vary depending on the system and the specific ODBC driver manager implementation. Ensure you know the correct paths for your system.
CONFIGURATION FILE FORMAT
The configuration file specified by the -f option must follow a specific format, typically in the .ini style. For drivers, it should include attributes like Driver, Description, FileUsage, UsageCount, Setup, and Driver64. For DSNs, it should include attributes such as Driver, Description, Database, Server, and other connection-specific parameters. Refer to the unixODBC documentation for complete details about the required attributes and their meaning.
RETURN CODES
odbcinst exits with 0 on success and >0 on errors.
HISTORY
odbcinst is part of the unixODBC project, an open-source implementation of the ODBC API for Unix-like operating systems. It was developed to provide a standardized way to manage ODBC driver and DSN configurations on these systems, addressing the need for a cross-platform solution for database connectivity. The command has been evolving with the unixODBC project.
SEE ALSO
isql(1), odbc.ini(5), odbcinst.ini(5)