ODBC Connector


The LeanXcale ODBC driver is available for Windows and Unix-like systems like Linux.

1. Installation

1.1. ODBC Linux Installation

The next steps shows how to install the LeanXcale ODBC Driver for Linux. This procedure has been tested in Ubuntu 20.04 LTS, but it should work on other distributions too.

  1. Install prerequisite packages:

    sudo apt-get install php7.4-odbc unixodbc

    You should change php7.4-odbc with the version of PHP you’re using.

  2. Download the ODBC Connector from the Drivers page and unpack it.

  3. Copy the file libodbclx.so into /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
  4. Create the file $HOME/.odbcinst.ini with this content:

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

    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

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, you must set these 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 will then be able to locate the files.

1.2. ODBC Windows Installation

  1. Download the ODBC Setup from the Drivers page

  2. Run the installer lx-odbc-setup-1.4.0setup.exe

  3. Install Visual C++ redistributable (if needed)

    Most likely, the Visual C++ redistributable is already installed. If so, choose cancel to skip this installation.

  4. Follow the setup guide; just click Next as needed.

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

1.2.1. Registry Keys

The setup adds the relevant keys to the registry:

Registry Editor

"LX DRIVER(x64)"="Installed"


1.3. ODBC Data Source Administrator

When the driver has been installed, you can add the data source from the ODBC Data Source Administrator.

1.3.1. Data Source

The datasource can be added from the User DSN tab

  1. Click Add

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


1.3.2. DSN setup

With the driver selected, you can 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


Not yet supported


LeanXcale server DNS or IP


LeanXcale server access port


Login to database


Database password


Error reporting level



Location of error log file




ANSI Encoding


The Windows ODBC driver is an an ANSI driver, but it supports unicode data.

2. Examples of use

Check the Quick Start guides of the following languages using the ODBC connector: