I Access

(click to open)

Quick Page Table of Contents


ODBC connect to IBM i

A few notes on ODBC connect 2-tier to IBM i that may be helpful.


Driver is available for the following platforms:


  • Windows

For IBM i Access for Windows, run the exe for your platform (64-bit/32-bit)

For the Windows Application Package:

  1. unzip the zip file and run the exe for you
  2. cd to Image64a or Image32, depending on whether you’re on 64-bit or 32-bit Windows
  3. run the setup.exe
  • Linux

Packaged as zip file like IBMiAccess_v1r1_LinuxAP.zip Zip file contains rpm and debs for various architectures: i386, x86_64, ppc, ppc64, ppc64le

If on rpm-based distro (RHEL, SLES, CentOS, Fedora, openSUSE, …) install the rpm using your package manager:
eg. zypper in ibm-iaccess-
eg. yum install ibm-iaccess-

Or rpm, but you’ll need to dependency resolution yourself…
rpm -ihv ibm-iaccess-

If on deb-based distro (Debian, Ubuntu, Mint, …) install the deb (NOTE: debs only currently built for Intel/x86 not POWER)
dpkg -i ibm-iaccess-

Run apt-get to install any dependencies and finish configuring things
apt-get install -f

Additionally, there are 32bit packages that can be co-installed with the 64-bit packages to enable both 32-bit and 64-bit applications to use the driver. These are suffixed with −32bit on the name
eg. ibm-iaccess-


On both Windows and Linux, the driver is registered with the Driver Manager automatically during installation. On Linux, it may not be installed if odbcinst is not found.
To fix, run the following command: odbcinst -i -d -f /opt/ibm/iaccess/unixodbcregistration

Creating a DSN

On Windows you can use ODBC Data Source Administrator in the Administrative Tools folder of the Control Panel

On Linux, you can create a DSN using the ODBCConfig GUI if your distribution still has it or edit the configuration files manually

First, run odbcinst -j to show where your paths are:

kadler@kadler:~$ odbcinst -j
unixODBC 2.2.14
DRIVERS............: /etc/odbcinst.ini
SYSTEM DATA SOURCES: /etc/odbc.ini
USER DATA SOURCES..: /home/kadler/.odbc.ini
SQLULEN Size.......: 8
SQLLEN Size........: 8

On this system, system-wide DSNs go in /etc/odbc.ini and user-only DSNs go in $HOME/.odbc.ini

The most minimal configuration needed is:

Driver          = IBM i Access ODBC Driver
System          = <system hostname>

For a list of DSN options, see this section of the Knowledge Center

Verifying configuration

On Linux you can verify using isql or iusql:

isql <dsn> <username> <password>

If isql is working there is a good chance that PHP odbc will be working.

$conn = odbc_connect("<dsn>","<username>","<password>");

64-bit Considerations for Linux

  • If you’re using pdo_odbc prior to PHP 5.6, there is a bug that will cause random crashes
  • If you’re using the old iSeriesAccess rpm you will have problems:
    • ODBC driver links against older odbcinst.so.1, causing rpm dependency errors
    • Not fully 64-bit compliant (32-bit SQLLEN parameters) causing random crashes when using modern unixODBC
    • Hasn’t been updated in years, many fixes and improvements missing
    • No Debian/Ubuntu support


Tony “Ranger” Cairns - IBM i PHP / PASE
Kevin Adler - IBM i PASE / DB2 / ODBC