Installing the Kognitio ODBC Driver

The Kognitio ODBC driver can be installed on Windows, MacOS and Linux clients:

The ODBC driver for Windows can be installed using the Kognitio Console installer which is available to download from the Kognitio Client Tools Download Page .

During installation you can choose to install Kognitio Console or select to only install the ODBC driver if you are using a different SQL submission or BI tool.

Once you have installed the ODBC driver you need to set up a Data Source Name (DSN) for your Kognitio server. This makes connecting to Kognitio easier and also saves having to update several places if the server IP address changes.

You can follow the walkthrough if you are using Kognitio console or follow these instructions:

  1. Open the Windows ODBC Data Sources (64bit) from your Windows start menu

  2. Select whether you want to Add a User DSN (for yourself only) or a System DSN for all users (you may need admin rights for this)

  3. Select Kognitio WX2 from the list of available drivers. If it is not in the list then you need to install the ODBC driver (see Kognitio Console installation for details)

  4. Complete the ODBC Driver Setup details for your Kognitio system:

    ../_images/console_dsn_04.png

    You need to supply:

    • Data Source Name: this is displayed in most SQL or BI tools in the connection options

    • Description [optional]: additional information of the Kognitio system. Useful for system DSNs which have multiple users.

    • Server Address(es): IP address(es) or domain name of your Kognitio system

    • The port for Kognitio. The default is 6550.

  5. Test the connection from your favoured SQL submission or BI tool.

To use ODBC to connect to Kognitio in a Linux environment we recommend using unixODBC (which we test against) as a driver manager.

This guide assumes you will be using unixODBC but if you want to use a different driver manager the information is still relevant.

  • Install unixODBC following the instructions on the download page.

  • Download the tar file containing the Linux client utilities, Kognitio Console and the ODBC drivers from the Kognitio client tools section of the All Downloads page.

  • Move the downloaded file to a new directory and extract it.

  • Create a directory to put the driver in.

  • Copy the UTF16 (unixODBC expects wide characters to be represented as UTF-16) library to the directory you created.

Example:

mkdir wxodbc
cd wxodbc
wget https://kognitio.com/forum/latest_linuxclients.tar.gz
tar -xvf latest_linuxclients.tar.gz
sudo mkdir /opt/kognitio/odbc/lib64
sudo cp lib64/libwcsodbc_utf16.so /opt/kognitio/odbc/lib64

Now you can create a DSN to access a Kognitio server. There are various options which are described in unixODBC without the GUI or you can use the GUI tools provided by unixODBC but the simplest method is to define the DSN in your local odbc.ini file ~/.odbc.ini.

Example (replace <server-address> with the IP address or domain name of your server):

[ODBC Data Sources]
KognitioTest=Test DSN

[KognitioTest]
Description=Kognitio Test
Driver=/opt/kognitio/odbc/lib64/libwcsodbc_utf16.so
ServerAddress=<server-address>

You can now test connectivity using isql (provided with unixODBC).

# the location of isql may vary - see unixODBC docs for your version
# replace <user> <password> with a suitable username and password
# the -v option gives a better error message for connection failures
/usr/local/bin/isql KognitioTest <user> <password> -v

More information on the options available for the DSN are on the ODBC attributes page.

Kognitio Console does not require ODBC to be installed on the Mac since it has it’s own embedded ODBC driver on this platform.

There are 2 generic Kognitio ODBC drivers for macOS dependent on your ODBC driver manager: unixODBC or iODBC. Different client applications work with different managers. Installation of both is possible. If you want ODBC access for submitting SQL programmatically from scripts then we recommend using unixODBC.

See also Using the Kognitio JDBC Driver.

Software that utilizes unixODBC include:

You will need to have unixodbc installed . We recommend doing this via the package manager brew (use the command brew install unixodbc):

  1. Download the Kognitio unixODBC driver for macOS dmg file from the Kognitio Client Tools Download Page .

  2. Drag pkg file it contains into your Applications/ directory

  3. Execute the pkg installation file. The installation automatically creates a system-wide “Kognitio” driver entry in the unixODBC odbcinst.ini file. Best practice is to use this driver entry in all Kognitio DSN definitions so any subsequent adminstration, such as updates, are automatically picked up by all DSNs.

  4. Create a file as an ODBC data source template, i.e. kog_odbc.template for a Kognitio DSN:

    [Kognitio_Test]
    Description = Test Kognitio
    Driver = Kognitio
    ServerAddress1 = <kognitio-ip-address>
    ServerPort1 = 6550
    

    This is a basic DSN definition. See our ODBC attributes quick reference for more options.

    Note: kognitio-ip-address can be either the IP address or the domain name of the Kognitio server

  5. As best practice we recommend using the unixODBC command odbcinst to deploy templates as DSNs. Various options are described in unixODBC without the GUI

    To install a DSN for the current user (adds entry to ~/.odbc.ini):

    odbcinst -i -s -f kog_odbc.template
    

    To install as a system DSN for all users (adds entry to /usr/local/etc/odbc.ini):

    odbcinst -i -s -l -f kog_odbc.template
    
  6. Test the connection with the isql command line utility supplied with unixODBC using your Kognitio account details:

    isql Kognitio_Test <user> <password> -v
    

    The -v option gives more error messaging for connection failures

Software that utilize iODBC include:

You will need to have iodbc installed . We recommend doing this via the package manager brew (use the command brew install libiodbc):

  1. Download the Kognitio iODBC driver for macOS dmg file from the Kognitio Client Tools Download Page and drag pkg file it contains into your Applications/ directory

  2. Execute the pkg installation file. The installation automatically creates a system-wide “Kognitio” driver entry in the /Library/ODBC/odbcinst.ini file. This is where iODBC searches for installed drivers on macOS. Best practice is to use this driver entry in all Kognitio DSN definitions so any subsequent adminstration, such as updates, are automatically picked up by all DSNs.

  3. Create a DSN for your Kognitio instance in the system odbc.ini file (e.g. /Library/ODBC/odbc.ini):

    # Declare the Kognitio DSN as a data source
    [ODBC Data Sources]
    Kognitio_Test= A Kognitio Test Data Source
    
    [Kognitio_Test]
    Driver = Kognitio
    ServerAddress1 = <kognitio-ip-address>
    ServerPort1 = 6550
    

    Note you need sudo privileges on the system to edit this file, otherwise contact your administrator. iODBC on Mac OS will not pick up DSNs created in the local user ~/.odbc.ini file by default.

    This is a basic DSN definition. See our ODBC attributes quick reference sheet for more options.

    Note: kognitio-ip-address can be either the IP address or the domain name of the Kognitio server.

  4. This connection can be tested using the iodbctest command utility supplied with iODBC and your Kognitio acccount details:

    iodbctest "DSN=Kognitio_Test;UID=<user>;PWD=<password>"