From YiPs Wiki (i powered)

Tier2: 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:


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

Packaged as zip file like 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


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

Retrieved from
Page last modified on April 22, 2015, at 06:12 PM EST