ODBC Connector


The LeanXcale ODBC driver is available for Windows and Unix-class systems, including Linux.

1. Installation

1.1. ODBC Linux Installation

The next steps show how to install the LeanXcale ODBC Driver for Linux. This procedure was tested on Ubuntu 20.04 LTS and is expected to run on other distributions.

  1. Install the prerequisite packages:

    sudo apt-get install unixodbc unixodbc-dev libprotobuf-c-dev

    The unixodbc-dev package is used by some extensions that need to be compiled before being installed.

    If you don’t have the Universe repository enabled in your Ubuntu installation, you can install the required libprotobuf-c-dev package by hand in the following way:

    wget http://archive.ubuntu.com/ubuntu/pool/universe/p/protobuf-c/libprotobuf-c-dev_1.3.3-1_amd64.deb
    sudo dpkg -i libprotobuf-c-dev_1.3.3-1_amd64.deb
  2. Download and unpack the ODBC Connector package for your operative system from the Drivers page.

  3. Make sure that all required dependencies are met:

    ldd libodbclx.so
  4. Copy the file libodbclx.so into the /opt/leanxcale/odbc/client directory:

    mkdir -p /opt/leanxcale/odbc/client
    cp libodbclx.so /opt/leanxcale/odbc/client

    Make sure that the PHP user has read and execute permissions for libodbclx.so.

    For example:

    chmod +rx www-data /opt/leanxcale/odbc/client/libodbclx.so
  5. Create the file $HOME/.odbcinst.ini with the following details:

    Description = LeanXcale ODBC Driver for Linux
    Driver = /opt/leanxcale/odbc/client/libodbclx.so
    UsageCount = 1
  6. Create the file $HOME/.odbc.ini with these details:

    Driver = LeanXcaleODBCDriver
    Description = Sample Database to be used for tests
    Trace = No
    Server =       # IP / hostname of your LeanXcale instance
    Port = 1529
    Database = dbtest
    UserName = user1
    Password = pass4user1
    Encoding = WCHAR_T
  7. If the LeanXcale Database you are connecting to is configured with Security, you must add the secure entry to the $HOME/.odbcinst.ini file.

    Driver = LeanXcaleODBCDriver
    Description = Sample Database to be used for tests
    Trace = No
    Server =       # IP / hostname of your LeanXcale instance
    Port = 1529
    Database = dbtest
    UserName = user1
    Password = pass4user1
    Encoding = WCHAR_T
    Secure = True

    Previously, you must have dowloaded and installed your TLS certificate, please check how to do this here.

By default, ODBC driver managers are configured to use hidden versions of the odbc.ini and odbcinst.ini configuration files (named .odbc.ini and .odbcinst.ini) located in the home directory.

If you store these configuration files elsewhere, then you must set the following environment variables:

  • Set ODBCINI to the full path and file name of the odbc.ini file.

  • Set ODBCSYSINI to the full path of the directory that contains the odbcinst.ini file.

The driver manager then must be able to locate these files.

1.2. ODBC Windows Installation

1.2.1. Installing the ODBC Connector

  1. Download the ODBC Connector for Windows from the Drivers page

  2. Run the installer lx-odbc-installer-1.7.10.msi

  3. The default installation directory is C:\Program Files\Leanxcale\lx-odbc-driver

  4. If asked to install the Visual C++ redistributable, then follow the default setup guide by simply clicking Next as needed.

Note that you would need to have Microsoft Visual C++ Redistributable package installed. Download the vcredist_x64.exe installer from an official site for Visual Studio 2019.

1.2.2. Registry Keys

The setup adds the following relevant keys to the registry:

Registry Editor

"LX DRIVER(x64)"="Installed"


1.2.3. ODBC Data Source Administrator

After the driver is installed, add the data source with the ODBC Data Source Administrator from the User DSN tab:.

  1. Click Add

  2. Select LX DRIVER(x64) from the driver list


With the correct driver selected, you can now configure the Data Source Name properties:

Property Description Sample Values Comment

Data Source

Identifier for the datasource

ODBC logical name


User friendly description of the database

Database name

Identifier for the database

SSL mode

SSL mode to use for connection


True to connect in secure mode


LeanXcale server DNS or IP


LeanXcale server access port


Login to database


Database password


Error reporting level



Location of error log file




ANSI Encoding


When using connecting to a LeanXcale instance with Security, the ODBC Driver Setup, SSL Mode must be set to True.


The Windows ODBC driver is an ANSI driver that also supports Unicode data.

2. Examples of use

Review the following Quick Start guides for the languages used with the ODBC connector: